Skip to content

Lazy hot path lookup for entities #1150

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 1 commit into
base: next
Choose a base branch
from

Conversation

jwbee
Copy link

@jwbee jwbee commented May 25, 2025

I noticed that ParseEntity was hot in the profiles of my workload and the only entity of interest was nbsp, which is pretty far down the list. This adds a lazily-constructed lookup table for the first character of the entity, preserving the overall strategy of ParseEntity but skipping the expensive scan for the 2nd and subsequent occurrences of any given entity.

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.

1 participant