maria-developers team mailing list archive
-
maria-developers team
-
Mailing list archive
-
Message #08550
Re: 696188f: MDEV-7951 - sql_alloc() takes 0.25% in OLTP RO
Hi, Sergey!
On Apr 17, svoj@xxxxxxxxxxx wrote:
> revision-id: 696188fe2f0756a98914df5b95ba302f7e5c55df
> parent(s): 0520a009c7139c940ab92345054bf0dba7808b11
> committer: Sergey Vojtovich
> branch nick: mariadb
> timestamp: 2015-04-17 14:30:15 +0400
> message:
>
> MDEV-7951 - sql_alloc() takes 0.25% in OLTP RO
>
> 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 implicitely at least by:
> - List<>::push_back()
> - List<>::push_front()
> - new (for Sql_alloc derived classes)
> - sql_memdup()
>
> Replaced lots of implicit sql_alloc() calls with direct mem_root allocation,
> passing through THD pointer whenever it is needed.
>
> Number of sql_alloc() calls reduced 345 -> 41 per OLTP RO transaction.
> pthread_getspecific() overhead dropped 0.76 -> 0.59
> sql_alloc() overhed dropped 0.25 -> 0.06
ok to push
Regards,
Sergei