Skip to content

Introduce a mapping to map sparse labels to a continuous range #14494

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

Open
wants to merge 111 commits into
base: main
Choose a base branch
from

Conversation

gf2121
Copy link
Contributor

@gf2121 gf2121 commented Apr 15, 2025

In ASCII encoding, numbers, lowercase letters, uppercase letters, and punctuation have discontinuous value ranges. This PR proposes to use a mapping to map the discontinuous value ranges to a continuous value range starting from 0. This can save some storage space and increase the probability of using the BITSET strategy instead of the ARRAY strategy, which may also improve some performance.

In luceneutil, this patch reduces ~1.5% size of tip, including ~5% for the id field, which encoded with base36 (numbers and lowercase letters). Performance is generally even.

@mikemccand
Copy link
Member

Whoa, exciting! I will try to review soon! Thanks @gf2121.

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