$ ./bench.test -test.bench=. -test.benchtime=5s -test.cpuprofile=/tmp/cpu.pprof
testing: warning: no tests to run
PASS
BenchmarkMap-4 500000000 15.9 ns/op
--- BENCH: BenchmarkMap-4
main_test.go:37: result: 100.000000
main_test.go:37: result: 10000.000000
main_test.go:37: result: 1000000.000000
main_test.go:37: result: 100000000.000000
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 | |
import ( | |
"encoding/json" | |
"errors" | |
"flag" | |
"fmt" | |
"io" | |
"io/ioutil" | |
"log" |
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
$ go test -bench=BenchmarkGenerateTimes | |
BenchmarkGenerateTimes 5000 261860 ns/op 212992 B/op 1 allocs/op |
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
1 10 100 1000 | |
--------------------------- | |
Append | 88ns | 63ns | 23ns | 14ns | | |
Append+Cap | 88ns | 16ns | 10ns | 8ns | | |
Index | 84ns | 14ns | 7ns | 6ns | |
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
IDENT = [a-z0-9_#@.&:*\[\]=""] | |
COMMENT = /* ... */ | |
COMMENT = // … | |
VARIABLE = @{...} | |
GT | |
COMMA | |
SEMICOLON | |
interpret vars in vars = @@ |
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
<html> | |
<body> | |
<p>Hello Embed.ly folks!</p> | |
<p>This is an example of a gist hosted by Gist Exposed!</p> | |
<p>Here's the <a href="https://gist.github.com/benbjohnson/ac58ab0a61cf49955790">original gist on GitHub</a></p> | |
<p>Here's a link to the GitHub project: <a href="https://github.com/benbjohnson/gist">Gist Exposed!</a></p> | |
</body> |
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
... append to the end of raft_test.go ... | |
func BenchmarkRaftTripleNode(b *testing.B) { | |
b.ReportAllocs() | |
// Make the cluster | |
c := MakeCluster(3, b, nil) | |
defer c.Close() | |
// Should be one leader |
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
<html> | |
<head> | |
<script src="test.js"></script> | |
</head> | |
<body> | |
<p>Testing</p> | |
<p>1...2...3...</p> | |
</body> | |
</html> |
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
$ bolt bench --batch-size 1 --count 10000 --write-mode rnd | |
# Write 4.102113174s (410.211us/op) (2437 op/sec) | |
$ bolt bench --batch-size 10 --count 100000 --write-mode rnd | |
# Write 12.084931999s (120.849us/op) (8274 op/sec) | |
$ bolt bench --batch-size 100 --count 100000 --write-mode rnd | |
# Write 5.436509914s (54.365us/op) (18394 op/sec) | |
$ bolt bench --batch-size 1000 --count 100000 --write-mode rnd |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
NewerOlder