Skip to content

fix: remove expensive clone in bitmap search#5409

Merged
westonpace merged 1 commit intolance-format:mainfrom
westonpace:perf/bitmap-perf-regression
Dec 4, 2025
Merged

fix: remove expensive clone in bitmap search#5409
westonpace merged 1 commit intolance-format:mainfrom
westonpace:perf/bitmap-perf-regression

Conversation

@westonpace
Copy link
Copy Markdown
Member

82df343 parallelizes bitmap loading but it introduced a clone of the bitmap index. Since this was a clone of the index itself and not just an arc clone it ended up being a very expensive deep clone, especially at scale. It also led to unbounded memory usage since all clones needed to live at the same time and this could cause the search to crash.

Fortunately, these clones are not needed, so we can simply remove them.

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

@github-actions github-actions Bot added the bug Something isn't working label Dec 4, 2025
@westonpace
Copy link
Copy Markdown
Member Author

Tested with the microbenchmark bitmap_in_5/string_unique/cached which went from 1.3294s per iteration to 77.812µs per iteration (this was in debug mode).

@westonpace westonpace requested a review from jackye1995 December 4, 2025 18:30
Copy link
Copy Markdown
Contributor

@jackye1995 jackye1995 left a comment

Choose a reason for hiding this comment

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

🚀

@codecov
Copy link
Copy Markdown

codecov Bot commented Dec 4, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Copy link
Copy Markdown
Collaborator

@Xuanwo Xuanwo left a comment

Choose a reason for hiding this comment

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

Nice catch!

@westonpace westonpace merged commit 33bd0a5 into lance-format:main Dec 4, 2025
25 of 26 checks passed
jackye1995 pushed a commit to jackye1995/lance that referenced this pull request Dec 5, 2025
lance-format@82df343
parallelizes bitmap loading but it introduced a clone of the bitmap
index. Since this was a clone of the index itself and not just an arc
clone it ended up being a very expensive deep clone, especially at
scale. It also led to unbounded memory usage since all clones needed to
live at the same time and this could cause the search to crash.

Fortunately, these clones are not needed, so we can simply remove them.
jackye1995 pushed a commit that referenced this pull request Dec 5, 2025
82df343
parallelizes bitmap loading but it introduced a clone of the bitmap
index. Since this was a clone of the index itself and not just an arc
clone it ended up being a very expensive deep clone, especially at
scale. It also led to unbounded memory usage since all clones needed to
live at the same time and this could cause the search to crash.

Fortunately, these clones are not needed, so we can simply remove them.
jackye1995 pushed a commit to jackye1995/lance that referenced this pull request Jan 21, 2026
lance-format@82df343
parallelizes bitmap loading but it introduced a clone of the bitmap
index. Since this was a clone of the index itself and not just an arc
clone it ended up being a very expensive deep clone, especially at
scale. It also led to unbounded memory usage since all clones needed to
live at the same time and this could cause the search to crash.

Fortunately, these clones are not needed, so we can simply remove them.
wkalt pushed a commit to wkalt/lance that referenced this pull request Jan 26, 2026
lance-format@82df343
parallelizes bitmap loading but it introduced a clone of the bitmap
index. Since this was a clone of the index itself and not just an arc
clone it ended up being a very expensive deep clone, especially at
scale. It also led to unbounded memory usage since all clones needed to
live at the same time and this could cause the search to crash.

Fortunately, these clones are not needed, so we can simply remove them.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants