-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Grow arrays by a factor less than 2? #8269
Labels
Comments
This seems like a good idea. |
ArrayList in Java uses 1.5 as growth factor and [1] gives a bit more background on why this might be considered more optimal. [1] http://crntaylor.wordpress.com/2011/07/15/optimal-memory-reallocation-and-the-golden-ratio/ |
stevengj
added a commit
to stevengj/julia
that referenced
this issue
May 10, 2016
stevengj
added a commit
to stevengj/julia
that referenced
this issue
May 10, 2016
stevengj
added a commit
to stevengj/julia
that referenced
this issue
Jan 28, 2017
stevengj
added a commit
to stevengj/julia
that referenced
this issue
Sep 17, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
I recently discovered this document in one of FB’s open source libraries for C++: https://github.com/facebook/folly/blob/master/folly/docs/FBVector.md
It makes an interesting argument for growing arrays by a factor smaller than 2 when resizing them so that you can reuse memory more easily. Not sure how much you also need to use a custom malloc routine to get the benefits being claimed, but I thought I'd raise the idea in case we can get any performance enhancements from these ideas.
The text was updated successfully, but these errors were encountered: