blaxill/static — pull request #1 by DisposaBoy (2013-08-05 13:49:39+00:00)
Title: * misc cleanups

you could also see more stable results by simply fetching the files in order instead of at random.

[ `go version` | done: 36.064151ms ]
go version go1.1 linux/amd64

old:

[ `go test -test.run=none -test.bench="^Benchmark" -cpu 1,2,4 -benchmem` | done: 29.473057053s ]
PASS
BenchmarkOriginal 10000 110185 ns/op 14125 B/op 104 allocs/op
BenchmarkOriginal-2 5000 631620 ns/op 14102 B/op 104 allocs/op
BenchmarkOriginal-4 5000 646266 ns/op 14168 B/op 104 allocs/op
BenchmarkCached 20000 85874 ns/op 12650 B/op 81 allocs/op
BenchmarkCached-2 10000 517357 ns/op 12721 B/op 81 allocs/op
BenchmarkCached-4 5000 548556 ns/op 12661 B/op 81 allocs/op
BenchmarkMemfs 10000 146477 ns/op 46474 B/op 99 allocs/op
BenchmarkMemfs-2 5000 640177 ns/op 46439 B/op 99 allocs/op
BenchmarkMemfs-4 5000 645501 ns/op 46473 B/op 99 allocs/op
ok github.com/blaxill/static 28.618s

new:

[ `go test -test.run=none -test.bench="^Benchmark" -cpu 1,2,4 -benchmem` | done: 28.090098332s ]
PASS
BenchmarkOriginal 20000 90427 ns/op 7871 B/op 100 allocs/op
BenchmarkOriginal-2 5000 581354 ns/op 7870 B/op 100 allocs/op
BenchmarkOriginal-4 5000 602386 ns/op 7870 B/op 100 allocs/op
BenchmarkCached 50000 66744 ns/op 6486 B/op 77 allocs/op
BenchmarkCached-2 5000 480580 ns/op 6486 B/op 77 allocs/op
BenchmarkCached-4 5000 522957 ns/op 6486 B/op 77 allocs/op
BenchmarkMemfs 10000 100038 ns/op 40277 B/op 95 allocs/op
BenchmarkMemfs-2 5000 561501 ns/op 40280 B/op 95 allocs/op
BenchmarkMemfs-4 5000 579472 ns/op 40275 B/op 95 allocs/op
ok github.com/blaxill/static 27.211s