> go test -bench=. -test.benchtime=20s
goos: darwin
goarch: amd64
BenchmarkCached-12 20000000 1173 ns/op 400 B/op 10 allocs/op
BenchmarkNotCached-12 5000000 7955 ns/op 2766 B/op 52 allocs/op
PASS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Better https://github.com/javiersuweijie/s3policy | |
var crypto = require('crypto'); | |
var path = require('path'); | |
var _ = require('lodash'); | |
var uuid = require('node-uuid'); | |
var mimetype = require('mimetype'); | |
var AWS = require('aws-sdk'); | |
var debug = require('debug')('s3policy'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
// https://github.com/nodejs/node/blob/master/src/node_crypto.cc#L4374 | |
import ( | |
"log" | |
"strings" | |
"github.com/spacemonkeygo/openssl" | |
) |
> go test -bench=. -test.benchtime=10s
BenchmarkMapIntZero-12 389632792 30.6 ns/op 48 B/op 1 allocs/op
BenchmarkMapInt100-12 16012993 824 ns/op 4176 B/op 3 allocs/op
BenchmarkMapInt1000-12 1420974 8083 ns/op 57424 B/op 3 allocs/op
BenchmarkMapInt10000-12 149038 83019 ns/op 458833 B/op 3 allocs/op
BenchmarkMapSliceStringZero-12 365958336 32.7 ns/op 48 B/op 1 allocs/op
BenchmarkMapSliceString100-12 10588574 1074 ns/op 6224 B/op 3 allocs/op
BenchmarkMapSliceString1000-12 809688 14690 ns/op 98385 B/op 3 allocs/op
I hereby claim:
- I am seriousben on github.
- I am seriousben (https://keybase.io/seriousben) on keybase.
- I have a public key ASBwVzwpscvJyPDjKnKBCSFJBaQMOdSn6ut6EtZJ-GnMmwo
To claim this, I am signing this object: