[MDEV-17491] micro optimize page_id_t Created: 2018-10-18 Updated: 2023-02-06 Resolved: 2018-10-29 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - InnoDB |
| Fix Version/s: | 10.3.11, 10.2.19 |
| Type: | Task | Priority: | Minor |
| Reporter: | Eugene Kosov (Inactive) | Assignee: | Eugene Kosov (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||
| Description |
|
Remove page_id_t::m_fold. This was added as an optimization but my benchmark shows it actually slows things down. http://quick-bench.com/p9tQCIFqk2MJgBrK_vp80YD6r8Y Updated page_id_t will be consisted of a two uint32_t. It can be transferred in one register in 64 bit platforms. So, pass it by value everywhere. |
| Comments |
| Comment by Marko Mäkelä [ 2018-10-23 ] |
|
Looks OK, but I’d request some related additional cleanup. |
| Comment by Eugene Kosov (Inactive) [ 2018-10-23 ] |
|
amd64: really passed in one `rdi` https://godbolt.org/z/YBAX0e i686: passed in a stack. And I don't know why https://godbolt.org/z/AZ3L9H aarch64: I don't know assembly. It looks like a struct was passed on a stack https://godbolt.org/z/q1ucnG |
| Comment by Eugene Kosov (Inactive) [ 2018-10-24 ] |
|
Cleanup done, PR updated. |
| Comment by Marko Mäkelä [ 2018-10-29 ] |
|
Thank you! I merged this along with some further cleanup. |
| Comment by Nikita Malyavin [ 2021-10-03 ] |
|
kevg Because it was 32-bit arm |
| Comment by Marko Mäkelä [ 2021-10-04 ] |
|
In 10.5, page_id_t was optimized further to be a wrapper of a single 64-bit integer, so that we can simplify comparisons. |