Still not beating Go-MySQL-Driver on my setup though (usual best-of-2 mode). The results are below.
The JDBC results for (Simple|Prepared)Query made me think. I'm also reworking my stream I/O right now.
I'll run another benchmark-round soon. Feel free to contribute to the benchmark suite.
SimpleQuery:
Go-MySQl-Driver 3923 | mymysql 3216 queries/second
PreparedQuery:
Go-MySQl-Driver 3716 | mymysql 4122 queries/second <- wow!
AutoQueryRow:
Go-MySQl-Driver 7748 | mymysql 6855 queries/second
SimpleQueryRow:
Go-MySQl-Driver 15075 | mymysql 6970 queries/second
PreparedQueryRow:
Go-MySQl-Driver 15539 | mymysql 14238 queries/second
SimpleExec:
Go-MySQl-Driver 29238 | mymysql 27306 queries/second
PreparedExec:
Go-MySQl-Driver 30384 | mymysql 28295 queries/second
Log:
*************************************************************
BENCHMARKING mymysql godrv [run 1]
*************************************************************
-------------------------------------------------------------
[10000 * Query 100 Rows]
-------------------------------------------------------------
SimpleQuery: 3.2581864s [ 3069 queries/second ]
PreparedQuery: 2.4971428s [ 4005 queries/second ]
-------------------------------------------------------------
[100 * QueryRow] * 1000
-------------------------------------------------------------
AutoQueryRow: 14.5888344s [ 6855 queries/second ]
SimpleQueryRow: 14.3458205s [ 6971 queries/second ]
PreparedQueryRow: 7.0234017s [ 14238 queries/second ]
-------------------------------------------------------------
[100000 * Exec]
-------------------------------------------------------------
SimpleExec: 3.6622094s [ 27306 queries/second ]
PreparedExec: 3.5452028s [ 28207 queries/second ]
*************************************************************
BENCHMARKING mymysql godrv [run 2]
*************************************************************
-------------------------------------------------------------
[10000 * Query 100 Rows]
-------------------------------------------------------------
SimpleQuery: 3.1091778s [ 3216 queries/second ]
PreparedQuery: 2.4261387s [ 4122 queries/second ]
-------------------------------------------------------------
[100 * QueryRow] * 1000
-------------------------------------------------------------
AutoQueryRow: 14.7788453s [ 6766 queries/second ]
SimpleQueryRow: 14.3478206s [ 6970 queries/second ]
PreparedQueryRow: 7.1074065s [ 14070 queries/second ]
-------------------------------------------------------------
[100000 * Exec]
-------------------------------------------------------------
SimpleExec: 3.776216s [ 26482 queries/second ]
PreparedExec: 3.5342021s [ 28295 queries/second ]