-
Notifications
You must be signed in to change notification settings - Fork 156
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
Shrink QueryRevisions
size by 3 words
#636
base: master
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for salsa-rs canceled.
|
CodSpeed Performance ReportMerging #636 will not alter performanceComparing Summary
|
I wonder if #629 would help here a bit by reducing the need to allocate additionally (or whether the cause of the perf regression is the extra indirection) |
I haven't reviewed the code changes but any chance you undid the optimization introduced in #615 |
Ah I believe I did by accident! |
d0b5fd4
to
96d7780
Compare
96d7780
to
009c91f
Compare
) -> Option<&'db AccumulatedMap>; | ||
) -> (Option<&'db AccumulatedMap>, InputAccumulatedValues) { | ||
_ = (db, key_index); | ||
(None, InputAccumulatedValues::Any) | ||
} |
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.
One thing to note is that I have this trait method a default impl to reduce some code noise. I imagine the intent was to force the implementor to think about this function but it does make changing signatures really annoying as well.
009c91f
to
0537864
Compare
0537864
to
dfec276
Compare
@@ -7,10 +9,6 @@ use super::{accumulated::Accumulated, Accumulator, AnyAccumulated}; | |||
#[derive(Default, Debug)] | |||
pub struct AccumulatedMap { | |||
map: FxHashMap<IngredientIndex, Box<dyn AnyAccumulated>>, |
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.
I guess a more local change would be to change map
here to Option<Box<FxHashMap>>
. It would have the advantage that all accumualted fields remain closer together.
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.
Generally not a bad idea but I think (will have to verify but I am fairly certain) that moving InputAccumulatedValues
back into AccumulatedMap
will increase the size of QueryRevisions
as the field can't be batched together with other fields that are smaller than the alignment.
This was a pretty substantial improvement to rust-analyzer's memory benchmark ( |
We could save another 24 bytes by option boxing |
And another 8 bytes by having access to a |
dfec276
to
4abb000
Compare
4abb000
to
eb4340b
Compare
No description provided.