Skip to content

Instantly share code, notes, and snippets.

@jackc
Created April 3, 2015 00:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jackc/d282f39e088b495fba3e to your computer and use it in GitHub Desktop.
Save jackc/d282f39e088b495fba3e to your computer and use it in GitHub Desktop.
github.com/jackc/go_db_bench benchmark run
# Run on Core i7 4770, 16GB RAM, SSD
jack@edi:~/dev/go/src/github.com/jackc/go_db_bench$ uname -a
Linux edi 3.13.0-48-generic #80-Ubuntu SMP Thu Mar 12 11:16:15 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
jack@edi:~/dev/go/src/github.com/jackc$ date
Thu Apr 2 19:39:07 CDT 2015
jack@edi:~/dev/go/src/github.com/jackc$ cd $GOPATH/src/github.com/jackc/pgx; git rev-parse HEAD
c45bb2cfa8cf801c75b374db7d2b0baa6da58f1c
jack@edi:~/dev/go/src/github.com/jackc/pgx$ cd $GOPATH/src/github.com/lib/pq; git rev-parse HEAD
a33d6053e025943d5dc89dfa1f35fe5500618df7
jack@edi:~/dev/go/src/github.com/lib/pq$ cd $GOPATH/src/github.com/go-pg/pg; git rev-parse HEAD
ba4ae6d3922b41fdc5df82107f95b7764cd7f16c
jack@edi:~/dev/go/src/github.com/jackc/go_db_bench$ GO_DB_BENCH_PG_HOST=/var/run/postgresql go test -test.bench=. -test.benchmem
testing: warning: no tests to run
PASS
BenchmarkPgxNativeSelectSingleValue 100000 29949 ns/op 364 B/op 10 allocs/op
BenchmarkPgxStdlibSelectSingleValue 50000 32721 ns/op 712 B/op 26 allocs/op
BenchmarkPgSelectSingleValue 50000 29427 ns/op 104 B/op 8 allocs/op
BenchmarkPqSelectSingleValue 50000 36735 ns/op 608 B/op 28 allocs/op
BenchmarkRawSelectSingleValue 100000 20847 ns/op 16 B/op 2 allocs/op
BenchmarkPgxNativeSelectSingleRow 50000 35591 ns/op 475 B/op 12 allocs/op
BenchmarkPgxStdlibSelectSingleRow 30000 47853 ns/op 1283 B/op 35 allocs/op
BenchmarkPgSelectSingleRow 50000 40334 ns/op 332 B/op 18 allocs/op
BenchmarkPqSelectSingleRow 30000 53810 ns/op 1063 B/op 45 allocs/op
BenchmarkRawSelectSingleRow 50000 25465 ns/op 15 B/op 1 allocs/op
BenchmarkPgxNativeSelectMultipleRows 10000 145069 ns/op 11865 B/op 114 allocs/op
BenchmarkPgxStdlibSelectMultipleRows 10000 171184 ns/op 18891 B/op 352 allocs/op
BenchmarkPgSelectMultipleRows 10000 224229 ns/op 7656 B/op 311 allocs/op
BenchmarkPqSelectMultipleRows 5000 251959 ns/op 18405 B/op 529 allocs/op
BenchmarkRawSelectMultipleRows 30000 44773 ns/op 16 B/op 1 allocs/op
ok github.com/jackc/go_db_bench 30.471s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment