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

Would be nice to have a with_capacity() constructor for Freelist #39

Open
alexpyattaev opened this issue Mar 26, 2023 · 0 comments
Open

Comments

@alexpyattaev
Copy link

alexpyattaev commented Mar 26, 2023

Just benchmarked your freelist implementation, and it is remarkably fast. Sadly, it lacks a way to preallocate the memory which tanks performance early on. Could you please add the with_capacity constructor? It should be fairly trivial as far as I understand.
You'd just need to change this line to Vec::with_capacity() and you basically get ready-made with_capacity constructor.

let mut data = vec![];

Thanks!

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

No branches or pull requests

1 participant