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

L0 flush: avoid short-lived allocation when checking key_range empty #8154

Merged
merged 1 commit into from
Jun 25, 2024

Conversation

problame
Copy link
Contributor

We only use keys to check if it's empty so we can bail out early. No need to collect the keys for that.

Found this while doing research for #7418

…e is empty

Found this while doing research for #7418
@problame problame requested a review from a team as a code owner June 25, 2024 11:20
@problame problame requested a review from skyzh June 25, 2024 11:20
Copy link
Contributor Author

@problame problame left a comment

Choose a reason for hiding this comment

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

@skyzh were you ever intending to do something special with that keys vector?

Copy link

2922 tests run: 2805 passed, 0 failed, 117 skipped (full report)


Code coverage* (full report)

  • functions: 32.5% (6876 of 21131 functions)
  • lines: 50.2% (53660 of 106975 lines)

* collected from Rust tests only


The comment gets automatically updated with the latest test results
fcf5518 at 2024-06-25T12:10:09.347Z :recycle:

Copy link
Member

@skyzh skyzh left a comment

Choose a reason for hiding this comment

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

LGTM. The original code uses hash map, and later there is a place that requires an ordered vector. Now it's B-tree map and therefore it's fine not to convert it to vec at all.

Thanks for the fix :)

@problame problame merged commit 947f6da into main Jun 25, 2024
64 checks passed
@problame problame deleted the problame/l0flush-avoid-allocation branch June 25, 2024 15:04
conradludgate pushed a commit that referenced this pull request Jun 27, 2024
…8154)

We only use `keys` to check if it's empty so we can bail out early. No
need to collect the keys for that.

Found this while doing research for
#7418
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.

None yet

2 participants