We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Currently library seems to grow vectors by the factor of 2 when size reaches capacity. Many languages, including GC based, choose 1.5 or other factors: https://stackoverflow.com/questions/1100311/what-is-the-ideal-growth-rate-for-a-dynamically-allocated-array https://sarahnothling.wordpress.com/2015/06/04/optimising-the-growth-factor-of-a-dynamic-array-list/
It's worth investigating, if it makes sense to change the default factor to phi or 1.5 in this context.
PS: Thanks for the library, I really miss this functionality from standard vector!
The text was updated successfully, but these errors were encountered:
change the growth factor to the golden ratio (#1)
9e14a96
I tried the growth factor of 4181 / 2584 ≒ φ, and it seems to improve the performance slightly so I went ahead with the change.
2 push/10000: OK (1.41s) 85.7 μs ± 6.6 μs golden ratio push/10000: OK (1.38s) 84.1 μs ± 6.7 μs
Thank you for the suggestion!
Sorry, something went wrong.
No branches or pull requests
Currently library seems to grow vectors by the factor of 2 when size reaches capacity.
Many languages, including GC based, choose 1.5 or other factors:
https://stackoverflow.com/questions/1100311/what-is-the-ideal-growth-rate-for-a-dynamically-allocated-array
https://sarahnothling.wordpress.com/2015/06/04/optimising-the-growth-factor-of-a-dynamic-array-list/
It's worth investigating, if it makes sense to change the default factor to phi or 1.5 in this context.
PS: Thanks for the library, I really miss this functionality from standard vector!
The text was updated successfully, but these errors were encountered: