Details
-
Task
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
None
-
None
Description
Current implementation buffer socket data.
Faster implementation would get socket available data in the buffer (limited to 16k) to permit to the socket to retrieve new data.
This corresponds to the option "useReadAheadInput" in MySQL connector.
benchmarks show huge improvement when having data, and neglectable slow the query without resultset (update / insert).
A quick benchmark results (average time for execution):
test = Select 10 000 rows with 10 columns
Benchmark Mode Cnt Score
cdata avgt 30 3801.067 ± 205.842 ms/op
mariadb avgt 30 3510.291 ± 83.382 ms/op
mariadb_old avgt 30 4119.216 ± 173.522 ms/op
mysql avgt 30 3696.746 ± 94.048 ms/op
test = Select * from mysql.user LIMIT 1
Benchmark Mode Cnt Score
cdata avgt 30 1070.429 ± 70.021 μs/op
mariadb avgt 30 167.911 ± 4.434 μs/op
mariadb_old avgt 30 168.994 ± 3.208 μs/op
mysql avgt 30 175.660 ± 2.307 μs/op
test = DO 1
Benchmark Mode Cnt Score
cdata avgt 30 451.108 ± 29.724 μs/op
mariadb avgt 30 109.408 ± 3.105 μs/op
mariadb_old avgt 30 108.920 ± 2.746 μs/op
mysql avgt 30 207.637 ± 1.262 μs/op
This show a small perf decrease for query without results (<1%) as expected, since driver now call available() on socket without need for those queries.
Query with small resultset have a small perf increase (<1%).
Big resultset have a real perf increase.