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

Try out a single hash function for static and dynamic atoms #38

Closed
kmcallister opened this issue Oct 22, 2014 · 0 comments
Closed

Try out a single hash function for static and dynamic atoms #38

kmcallister opened this issue Oct 22, 2014 · 0 comments

Comments

@kmcallister
Copy link
Contributor

Suggested by roc here.

bors-servo pushed a commit that referenced this issue Sep 1, 2015
Reuse phf hash and remove phf::OrderedSet indirection

<s>Do not merge yet.</s> This depends on rust-phf/rust-phf#62

Use the `phf_shared` and `phf_generator` crates directly instead of `phf`. This allows us to re-use the phf hash in the dynamic table and avoid hashing the same string again.

Also remove the indirection of `phf::OrderedSet` compared to `phf::Set`: we don’t care about the order, only about getting numeric indices. (The optimization mentioned in a comment of using a bit map of the first 64 atoms in the html5ever tree builder was never implemented. If we want it, the indirection and order preservation can be added back while preserving the hash reuse.)

Fixes #38.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/string-cache/103)
<!-- Reviewable:end -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant