-
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
Revise VecPerParamSpace
to use a one Vec rather than three
#15418
Conversation
@pcwalton I think you were right, that the memory usage increase was due to malloc slop. (That, or my |
There are some build errors in rustdoc: https://travis-ci.org/rust-lang/rust/jobs/29158017 |
// | ||
// AF(self) = (self.content.slice_to(self.type_limit), | ||
// self.content.slice(self.type_limit, self.self_limit), | ||
// self.content.slice(self.self_limit, self.content.len())) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
slice_from
fwiw.
r=me with @huonw's comment change. |
This basically meant changing the interface so that no borrowed `&Vec` is exposed, by hiding `fn get_vec` and `fn get_mut_vec` and revising `fn all_vecs`. Instead, clients should use one of the other methods; `get_slice`, `pop`, `truncate`, `replace`, `push_all`, or `is_empty_in`, which should work for any case currently used in rustc.
In my informal measurements, this brings the peak memory usage when building librustc from 1662M down to 1502M. Since 1662 - 1502 = 160, this may not recover the entirety of the observed memory regression (250M) from PR rust-lang#14604. (However, according to my local measurements, the regression when building librustc was more like 209M, so perhaps this will still recover the lions share of the lost memory.)
…cwalton In my informal measurements, this brings the peak memory usage when building librustc from 1662M down to 1502M. Since 1662 - 1502 = 160, this may not recover the entirety of the observed memory regression (250M) from PR #14604. (However, according to my local measurements, the regression when building librustc was more like 209M, so perhaps this will still recover the lions share of the lost memory.)
This did fix the vast majority of the regression: http://huonw.github.io/isrustfastyet/mem/#b00f4ec,e0d3cf6! (Saved 225 MB there, but there is some noise.) |
Interesting. This provides some evidence for a hypothesis of mine: that aggressive use of |
@nikomatsakis if that hypothesis were true, then it would have sufficed to add I mention this because adding |
I see, I didn't really read the patch and misunderstood what it did. Interesting! |
Fix signature help of methods from macros Currently the receiver type is copied from AST instead re-formatting through `HirDisplay`. Macro generated functions seem to have no spaces and their signature help are rendered like `fn foo(&'amutself)` instead of `fn foo(&'a mut self)`.
In my informal measurements, this brings the peak memory usage when
building librustc from 1662M down to 1502M. Since 1662 - 1502 = 160,
this may not recover the entirety of the observed memory regression
(250M) from PR #14604. (However, according to my local measurements,
the regression when building librustc was more like 209M, so perhaps
this will still recover the lions share of the lost memory.)