Bug #101024 | GCC malloc function attribute | ||
---|---|---|---|
Submitted: | 1 Oct 2020 12:55 | Modified: | 9 Oct 2020 8:00 |
Reporter: | Georgy Kirichenko | Email Updates: | |
Status: | Verified | Impact on me: | |
Category: | MySQL Server: Compiling | Severity: | S5 (Performance) |
Version: | 8.0 | OS: | Any |
Assigned to: | Marc ALFF | CPU Architecture: | Any |
Tags: | Contribution |
[1 Oct 2020 12:55]
Georgy Kirichenko
[1 Oct 2020 12:56]
Georgy Kirichenko
I will submit corresponding sysbench results ASAP.
[1 Oct 2020 13:25]
MySQL Verification Team
Hello Georgy Kirichenko, Thank you for the report and contribution. regards, Umesh
[1 Oct 2020 14:54]
Georgy Kirichenko
Thanks Umesh! I made a mistake - function my_realloc obviously should not be marked with malloc attribute as it is not necessarily that my_realloc allocates a new chunk of memory. I will submit updated contribution ASAP.
[9 Oct 2020 7:57]
Georgy Kirichenko
Below is table containing single-thread sysbench results showing performance improvement with patch applied on a X86_64 system | test | threads | vanilla | malloc_attr | diff | |:-------:|--------:|--------------:|-------------:|------:| | OLTP_PS | 1 | 19407.75 | 19641.70 | 1.21% | | OLTP_RO | 1 | 738.05 | 739.01 | 0.13% | | OLTP_RW | 1 | 366.87 | 367.91 | 0.28% |
[9 Oct 2020 8:00]
Georgy Kirichenko
The table above was got on MySQL 8.0 compiled with -O3 because with -O2 the performance gain is modest so I am working on highlighting concrete optimization flag set allowing MY_ATTRIBUTE((malloc)) do the job.
[9 Oct 2020 15:57]
Marc ALFF
Point noted about realloc and the revised patch. Thanks for the contribution.