[MDEV-12345] Performance : Remove calls to clock() in trx_start_low Created: 2017-03-23 Updated: 2022-01-14 Resolved: 2017-03-23 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - InnoDB |
| Affects Version/s: | 10.1 |
| Fix Version/s: | 10.1.23 |
| Type: | Bug | Priority: | Major |
| Reporter: | Vladislav Vaintroub | Assignee: | Vladislav Vaintroub |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Attachments: |
|
| Description |
|
The point-select sysbench benchmark I ran recently on 10.2 shows rather high time spent in The inspection reveals that clock() call introduced inside trx_start_low by this patch https://github.com/MariaDB/server/commit/74961760a4837d2deb33336329c28cf9ad9b4e9e is responsible for the most calls (also, in 10.2, clock() was erroneously done twice). The call can be replaced by the value of THD::start_utime. |
| Comments |
| Comment by Vladislav Vaintroub [ 2017-03-23 ] |
|
Attached callgraph data taken with perf during the sysbench run |
| Comment by Marko Mäkelä [ 2017-03-23 ] |
|
The fix looks OK to me. |
| Comment by Vladislav Vaintroub [ 2017-03-23 ] |
|
Attached are the non-transactional point-select benchmark numbers ran with 256 user on a 32core machine (it is 10.2)., with or without clock() in trx_start_ow. Quite surprising speedup (more than 3 times, from 126325 to 379186 qps). On a weaker Windows box that I have tested, it was more like 15% improvement. clock_get_time must be very expensive on this benchmark machine. |
| Comment by Vladislav Vaintroub [ 2017-03-23 ] |
|
Fixed in 10.1 now |