Skip to content

Reduce numeric selector scan overhead while preserving features - #1240

Open
njohari-oai wants to merge 1 commit into
meta:devfrom
njohari-oai:numeric-selector-feature-scan
Open

njohari-oai wants to merge 1 commit into
meta:devfrom
njohari-oai:numeric-selector-feature-scan

Conversation

@njohari-oai

Copy link
Copy Markdown

Summary

The numeric selector keeps a small sample of value hashes. Once the sample is full, most new hashes can be rejected by comparing them with the largest hash in the heap. Inline that check so only values that can enter the sample call the heap update.

The cardinality scan now computes four hashes per iteration and processes them in their original order. For 16- and 32-bit inputs, the sum of absolute differences fits in 64 bits at the maximum supported element count. Use a 64-bit accumulator in the decision-only scan for those inputs.

On arm64, level-7 encoding of one page of 32,768 Open Targets interaction scores took 1.605 ms of encoder thread CPU time per call, down from 1.815 ms. The median reduction was 11.6% across 12 paired groups of runs.

Type of Change

Performance improvement.

Test Plan

  • Compared level-7 output on nine generated 16-, 32-, and 64-bit arrays. Both builds produced identical frames and decoded each other's output.
  • Ran ctest --output-on-failure on Linux x86-64. All 2,059 tests passed.

@meta-cla meta-cla Bot added the cla signed label Oct 30, 2026
@njohari-oai
njohari-oai marked this pull request as ready for review October 30, 2026 06:04
@Cyan4973 Cyan4973 self-assigned this Oct 31, 2026
@njohari-oai
njohari-oai force-pushed the numeric-selector-feature-scan branch from 96e0e55 to 577cd1f Compare November 3, 2026 00:48

This branch has not been deployed

No deployments
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.

2 participants