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

Reduce copies of LockInfo #5172

Closed
wants to merge 1 commit into from
Closed

Reduce copies of LockInfo #5172

wants to merge 1 commit into from

Conversation

lth
Copy link
Contributor

@lth lth commented Apr 10, 2019

The LockInfo struct is not easy to copy because it contains std::vector. Reduce copies by using move constructor and unordered_map::emplace.

2% improvement on a microbenchmark which calls GetForUpdate + Put(assume_tracked = true) in batch of 100k keys in a single threaded loop.

before
169768.4 keys per second
after
173403.1 keys per second

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lth has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

Copy link
Contributor

@siying siying left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for improving it!

@facebook-github-bot
Copy link
Contributor

@lth merged this pull request in ef0fc1b.

vagogte pushed a commit to vagogte/rocksdb that referenced this pull request Jun 18, 2019
Summary:
The LockInfo struct is not easy to copy because it contains std::vector. Reduce copies by using move constructor and `unordered_map::emplace`.
Pull Request resolved: facebook#5172

Differential Revision: D14882053

Pulled By: lth

fbshipit-source-id: 93999ec6ab1a5841fb5115abb764b6c1831a6de1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants