Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Issue#45]Trx-sys optimization #48

Conversation

zwang28
Copy link

@zwang28 zwang28 commented Apr 12, 2021

trx_sys_t::rw_trx_set is implemented as std::set, which does a few quite
expensive operations under trx_sys_t::mutex protection: e.g. malloc/free
when adding/removing elements. Traversing b-tree is not that cheap either.

This has negative scalability impact, which is especially visible when running
oltp_update_index.lua benchmark on a ramdisk.

To reduce trx_sys_t::mutex contention std::set is replaced with LF_HASH. None
of LF_HASH operations require trx_sys_t::mutex (nor any other global mutex)
protection.

@zwang28 zwang28 changed the title Issue#45 Replace trx_sys_t::rw_trx_set with LF_HASH Issue#45 Trx-sys optimization Apr 12, 2021
@zwang28 zwang28 changed the title Issue#45 Trx-sys optimization [Issue#45]Trx-sys optimization Apr 12, 2021
@zwang28 zwang28 linked an issue Apr 12, 2021 that may be closed by this pull request
@zwang28 zwang28 force-pushed the trx-sys-optimization branch 2 times, most recently from 1169292 to 00f8955 Compare April 12, 2021 12:04
@zwang28 zwang28 requested a review from bzhaoopenstack April 12, 2021 12:05
trx_sys_t::rw_trx_set is implemented as std::set, which does a few quite
expensive operations under trx_sys_t::mutex protection: e.g. malloc/free
when adding/removing elements. Traversing b-tree is not that cheap either.

This has negative scalability impact, which is especially visible when running
oltp_update_index.lua benchmark on a ramdisk.

To reduce trx_sys_t::mutex contention std::set is replaced with LF_HASH. None
of LF_HASH operations require trx_sys_t::mutex (nor any other global mutex)
protection.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants