[CONC-196] alloc_root is about 4 times slower (compared to libmysql) Created: 2016-08-03  Updated: 2017-04-03  Resolved: 2016-08-03

Status: Closed
Project: MariaDB Connector/C
Component/s: None
Affects Version/s: 3.0.0, 2.3.0
Fix Version/s: 3.0.1, 2.3.1

Type: Bug Priority: Major
Reporter: Georg Richter Assignee: Georg Richter
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Problem/Incident
causes ODBC-31 High CPU usage and low network utiliz... Closed

 Description   

Due to unnecessary loops alloc_root() function is about 4 times slower.
For a complete description and test case please check ODBC-31



 Comments   
Comment by Georg Richter [ 2016-08-03 ]

Fixed in revisions:
C/C 3.0.1: 7b146034383085bff38b19d9f6399a90896faf02
C/C 2.3.1: ac6078066c26473009fbea2f29cabed87a4f4466

Comment by René Cannaò [ 2017-04-03 ]

Georg, in ac6078066c26473009fbea2f29cabed87a4f4466 , the multiplier here was chosen randomly?
For ProxySQL (that uses libmariadbclient) and sysbench workload, replacing

(mem_root->block_size & ~1) * (mem_root->block_num >> 2)

with

(mem_root->block_size & ~1) * 2

improves performance by 10x

Generated at Thu Feb 08 03:03:34 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.