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

chore: prefetch keys in opmget #4778

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

chore: prefetch keys in opmget #4778

wants to merge 1 commit into from

Conversation

romange
Copy link
Collaborator

@romange romange commented Mar 16, 2025

Also, stop deduplicating keys by default, but keep it as a run-time flag.
All in all, this PR improves MGET (100% miss) throughput by at least 7%:
from 1.23M to 1.32M qps.
(100% miss traffic allows measuring more effectively the impact of this code)

Also, finally fix TieredStorageTest.FlushAll test.

@romange romange force-pushed the Prefetch branch 2 times, most recently from 2ae1ba8 to e01e062 Compare March 16, 2025 13:50
@romange romange requested a review from BorysTheDev March 16, 2025 13:50
@romange romange force-pushed the Prefetch branch 3 times, most recently from df12b53 to 6336ef0 Compare March 16, 2025 15:04
Also, stop deduplicating keys by default, but keep it as a run-time flag.
All in all, this PR improves MGET (100% miss) throughput by at least 7%:
from 1.23M to 1.32M qps.
(100% miss traffic allows measuring more effectively the impact of this code)

Also, finally fix TieredStorageTest.FlushAll test.

Signed-off-by: Roman Gershman <[email protected]>
Comment on lines +572 to +581
constexpr unsigned kPrefetchLimit = 32;
if (mget_prefetch_keys) {
unsigned prefetched = 0;
for (string_view key : keys) {
pt.Prefetch(key);
if (++prefetched >= kPrefetchLimit) {
break;
}
}
}
Copy link
Contributor

@BorysTheDev BorysTheDev Mar 17, 2025

Choose a reason for hiding this comment

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

Can we move it before key_index.reserve() or even higher to have more time for memory prefetching?

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.

2 participants