[MDEV-8010] Avoid sql_alloc() in Items Created: 2015-04-17  Updated: 2015-08-21  Resolved: 2015-08-21

Status: Closed
Project: MariaDB Server
Component/s: OTHER
Fix Version/s: 10.1.7

Type: Task Priority: Major
Reporter: Sergey Vojtovich Assignee: Sergey Vojtovich
Resolution: Fixed Votes: 0
Labels: None

Attachments: Text File mdev8010.patch    
Issue Links:
PartOf
is part of MDEV-6152 Remove calls to current_thd while cre... Closed
Epic Link: Performance: micro optimizations
Sprint: 10.1.7-2

 Description   

sql_alloc() has additional costs compared to direct mem_root allocation:

  • function call: it is defined in a separate translation unit and can't be inlined
  • it needs to call pthread_getspecific() to get THD::mem_root

It is called dozens of times implicitly by Items. Try to get rid of those calls.



 Comments   
Comment by Sergey Vojtovich [ 2015-08-11 ]

monty, please review attached patch.

Comment by Michael Widenius [ 2015-08-13 ]

Review done per email. Please fix the very few issues and then ok to push

Comment by Michael Widenius [ 2015-08-13 ]

See email

Generated at Thu Feb 08 07:23:58 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.