forked from rust-phf/rust-phf
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Previously, each `try_generate_hash` call would allocate a bunch of new `Vec`s just to throw them away every time. Now, all these `Vec`s are kept around in a stateful `Generator` struct and reused across multiple `try_generate_hash` calls. As generation of the PHF is probabilistic, it may need lots of trials, and reusing allocations across multiple trials may be benefitial.
- Loading branch information
Showing
1 changed file
with
111 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters