-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Investigate dynamic Vec growth strategy for jemalloc hugs #27627
Comments
Note that our strategy current boils down to:
See: http://doc.rust-lang.org/nightly/src/alloc/raw_vec.rs.html#138-214 Doubling in conjuction with with The For reference, the change to would be to instead do something like:
This should be a new method, as |
I remember hearing that grow factor of 1.5 is better than 2, but I don't remember where it was or whether it is confirmed in any way. |
https://blog.mozilla.org/nnethercote/2014/11/04/please-grow-your-buffers-exponentially/ is useful reading. There's a comment thread about the 1.5 vs. doubling thing, too. |
@nagisa this is the assertion of the second-last link in the OP -- however the last link found negligible gains for Rust in some benchmark. May want to scour e.g. https://github.com/facebook/folly/blob/master/folly/test/FBVectorTestBenchmarks.cpp.h for interesting workloads. |
Note that applying this logic to |
The only interesting workloads in FBVectorTestBenchmarks.cpp.h#L337 seem to be the |
Triage: it's been almost four years; doesn't seem like anyone has looked into this. We don't use jemalloc by default anymore. |
cc @nnethercote |
Closing in favor of #29931 since it seems at least "mostly the same" and given the lack of ongoing effort two bugs seems not useful. |
Facebook's alternative C++ STL uses a rather dynamic strategy to ostensibly be friendly for common workloads and jemalloc's size classes. While most of FBVector's stuff is hacking around the fact the move/copy constructors are Awful, this seems applicable to us.
See:
The text was updated successfully, but these errors were encountered: