Skip to content

Instantly share code, notes, and snippets.

@jackc
Created July 21, 2017 20:45
Show Gist options
  • Save jackc/4996e8648a0c59839bff644f49d6e434 to your computer and use it in GitHub Desktop.
Save jackc/4996e8648a0c59839bff644f49d6e434 to your computer and use it in GitHub Desktop.
github.com/jackc/go_db_bench results
$ PGHOST=/var/run/postgresql go test -bench . -benchmem
BenchmarkPgxNativeSelectSingleShortString-8 100000 17873 ns/op 292 B/op 6 allocs/op
BenchmarkPgxStdlibSelectSingleShortString-8 100000 20602 ns/op 907 B/op 24 allocs/op
BenchmarkPgSelectSingleShortString-8 100000 17451 ns/op 120 B/op 8 allocs/op
BenchmarkPqSelectSingleShortString-8 100000 22604 ns/op 832 B/op 25 allocs/op
BenchmarkRawSelectSingleShortValue-8 100000 15735 ns/op 6 B/op 0 allocs/op
BenchmarkPgxNativeSelectSingleShortBytes-8 100000 17808 ns/op 314 B/op 7 allocs/op
BenchmarkPgxStdlibSelectSingleShortBytes-8 100000 20891 ns/op 933 B/op 25 allocs/op
BenchmarkPqSelectSingleShortBytes-8 50000 22005 ns/op 856 B/op 26 allocs/op
BenchmarkPgxNativeSelectSingleRow-8 100000 21577 ns/op 478 B/op 8 allocs/op
BenchmarkPgxStdlibSelectSingleRow-8 50000 27239 ns/op 1713 B/op 43 allocs/op
BenchmarkPgSelectSingleRow-8 100000 21146 ns/op 236 B/op 13 allocs/op
BenchmarkPqSelectSingleRow-8 50000 31295 ns/op 1232 B/op 39 allocs/op
BenchmarkRawSelectSingleRow-8 100000 17751 ns/op 6 B/op 0 allocs/op
BenchmarkPgxNativeSelectMultipleRows-8 20000 60668 ns/op 2940 B/op 80 allocs/op
BenchmarkPgxStdlibSelectMultipleRows-8 20000 88806 ns/op 7659 B/op 377 allocs/op
BenchmarkPgSelectMultipleRowsCollect-8 20000 70991 ns/op 9499 B/op 209 allocs/op
BenchmarkPgSelectMultipleRowsAndDiscard-8 30000 42872 ns/op 16 B/op 3 allocs/op
BenchmarkPqSelectMultipleRows-8 20000 98948 ns/op 6437 B/op 420 allocs/op
BenchmarkRawSelectMultipleRows-8 50000 36668 ns/op 12 B/op 0 allocs/op
BenchmarkPgxNativeSelectMultipleRowsBytes-8 20000 62072 ns/op 3471 B/op 155 allocs/op
BenchmarkPgxStdlibSelectMultipleRowsBytes-8 20000 90963 ns/op 8453 B/op 452 allocs/op
BenchmarkPqSelectMultipleRowsBytes-8 10000 101824 ns/op 7093 B/op 495 allocs/op
BenchmarkPgxNativeSelectBatch3Query-8 50000 25936 ns/op 1758 B/op 35 allocs/op
BenchmarkPgxNativeSelectNoBatch3Query-8 30000 40820 ns/op 807 B/op 14 allocs/op
BenchmarkPgxStdlibSelectNoBatch3Query-8 30000 49556 ns/op 2655 B/op 68 allocs/op
BenchmarkPqSelectNoBatch3Query-8 30000 48419 ns/op 2440 B/op 71 allocs/op
BenchmarkPgxNativeSelectLargeTextString1KB-8 100000 18147 ns/op 2637 B/op 6 allocs/op
BenchmarkPgxNativeSelectLargeTextString8KB-8 30000 41448 ns/op 22008 B/op 8 allocs/op
BenchmarkPgxNativeSelectLargeTextString64KB-8 10000 230627 ns/op 143608 B/op 8 allocs/op
BenchmarkPgxNativeSelectLargeTextString512KB-8 1000 1859720 ns/op 1061123 B/op 8 allocs/op
BenchmarkPgxNativeSelectLargeTextString4096KB-8 100 17692427 ns/op 8401207 B/op 8 allocs/op
BenchmarkPgxStdlibSelectLargeTextString1KB-8 100000 19651 ns/op 3253 B/op 24 allocs/op
BenchmarkPgxStdlibSelectLargeTextString8KB-8 30000 44102 ns/op 22624 B/op 26 allocs/op
BenchmarkPgxStdlibSelectLargeTextString64KB-8 5000 241644 ns/op 144223 B/op 26 allocs/op
BenchmarkPgxStdlibSelectLargeTextString512KB-8 1000 1915277 ns/op 1061721 B/op 26 allocs/op
BenchmarkPgxStdlibSelectLargeTextString4096KB-8 100 19229182 ns/op 8401820 B/op 26 allocs/op
BenchmarkPgSelectLargeTextString1KB-8 100000 16684 ns/op 1144 B/op 8 allocs/op
BenchmarkPgSelectLargeTextString8KB-8 30000 40092 ns/op 16504 B/op 9 allocs/op
BenchmarkPgSelectLargeTextString64KB-8 10000 243092 ns/op 131192 B/op 9 allocs/op
BenchmarkPgSelectLargeTextString512KB-8 1000 1902161 ns/op 1048697 B/op 9 allocs/op
BenchmarkPgSelectLargeTextString4096KB-8 100 18205067 ns/op 8388734 B/op 9 allocs/op
BenchmarkPqSelectLargeTextString1KB-8 100000 20837 ns/op 3000 B/op 26 allocs/op
BenchmarkPqSelectLargeTextString8KB-8 30000 44513 ns/op 18488 B/op 26 allocs/op
BenchmarkPqSelectLargeTextString64KB-8 10000 240353 ns/op 140088 B/op 26 allocs/op
BenchmarkPqSelectLargeTextString512KB-8 1000 1940351 ns/op 1057596 B/op 26 allocs/op
BenchmarkPqSelectLargeTextString4096KB-8 100 18242151 ns/op 8397637 B/op 26 allocs/op
BenchmarkPgxNativeSelectLargeTextBytes1KB-8 100000 18814 ns/op 3677 B/op 7 allocs/op
BenchmarkPgxNativeSelectLargeTextBytes8KB-8 30000 42918 ns/op 30216 B/op 9 allocs/op
BenchmarkPgxNativeSelectLargeTextBytes64KB-8 10000 239223 ns/op 209160 B/op 9 allocs/op
BenchmarkPgxNativeSelectLargeTextBytes512KB-8 1000 1791546 ns/op 1585426 B/op 9 allocs/op
BenchmarkPgxNativeSelectLargeTextBytes4096KB-8 100 18165508 ns/op 12595400 B/op 9 allocs/op
BenchmarkPgxStdlibSelectLargeTextBytes1KB-8 100000 20595 ns/op 4293 B/op 25 allocs/op
BenchmarkPgxStdlibSelectLargeTextBytes8KB-8 30000 46295 ns/op 30832 B/op 27 allocs/op
BenchmarkPgxStdlibSelectLargeTextBytes64KB-8 5000 241008 ns/op 209775 B/op 27 allocs/op
BenchmarkPgxStdlibSelectLargeTextBytes512KB-8 1000 1764788 ns/op 1586042 B/op 27 allocs/op
BenchmarkPgxStdlibSelectLargeTextBytes4096KB-8 100 19105840 ns/op 12596027 B/op 27 allocs/op
BenchmarkPqSelectLargeTextBytes1KB-8 100000 20888 ns/op 4040 B/op 27 allocs/op
BenchmarkPqSelectLargeTextBytes8KB-8 30000 46888 ns/op 26696 B/op 27 allocs/op
BenchmarkPqSelectLargeTextBytes64KB-8 5000 245623 ns/op 205640 B/op 27 allocs/op
BenchmarkPqSelectLargeTextBytes512KB-8 1000 1806309 ns/op 1581904 B/op 27 allocs/op
BenchmarkPqSelectLargeTextBytes4096KB-8 100 18775426 ns/op 12592001 B/op 27 allocs/op
PASS
ok github.com/jackc/go_db_bench 120.757s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment