Skip to content

perf(kll): binary search sorted levels in rank queries - #308

Merged
tisonkun merged 7 commits into
apache:mainfrom
Xuanwo:xuanwo/kll-sorted-rank
Oct 27, 2026
Merged

tisonkun merged 7 commits into
apache:mainfrom
Xuanwo:xuanwo/kll-sorted-rank

Conversation

@Xuanwo

@Xuanwo Xuanwo commented Oct 27, 2026 •

Copy link
Copy Markdown
Member

KllSketch::rank scans retained items even when their levels are already sorted. Use binary search for sorted levels and linear scans for unsorted level zero and single-level exact sketches. Separate counting from weighted accumulation, using <= for inclusive ranks and < for exclusive ranks.

The existing duplicate-value test now covers compaction. Validated with cargo x check, cargo x test, and cargo x lint.

@tisonkun
tisonkun enabled auto-merge (squash) October 27, 2026 09:49
@tisonkun
tisonkun merged commit 6d62125 into apache:main Oct 27, 2026
10 checks passed
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