Skip to content
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

feat(heap): Implement a simple string interner #457

Closed

Conversation

eliassjogreen
Copy link
Member

@eliassjogreen eliassjogreen commented Nov 4, 2024

A quite simple implementation of a string interner as a AHashMap<StringHeapData, StringIndex> lookup table. Seems to be broken and breaking tests, probably for a good reason. Ideally I would like the lookup table to not take StringHeapData as the key and instead take something like &'a str but that would require a lifetime for the heap. Far from mergeable as is.

Warning

Needs to be implemented using a HashTable<...> instead. See Map/Set for reference.

Greatly speeds up operations where there are lots of strings.

Co-authored-by: Dean Srebnik <load1n9@users.noreply.github.com>
@eliassjogreen
Copy link
Member Author

eliassjogreen commented Nov 6, 2024

Got stuck trying to implement it using HashTable. May re-open in the future.

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