-
Notifications
You must be signed in to change notification settings - Fork 235
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
chore(perf): try making AliasSet an enum #7057
Conversation
Execution Memory Report
|
Compilation Memory Report
|
Compilation Report
|
Execution Report
|
https://crates.io/crates/vec-collections could be useful here. |
It's a bit strange because in another recent PR, for example #7056, we get this: Here we get this: The 100% increase doesn't make sense 🤔 |
Those percentages have been a bit suss for a while, I tend to go off the raw figures generally. I've got plans to move us off of that github action anyway. |
@asterite Thoughts on https://crates.io/crates/vec-collections which could extend some of the benefits of this PR past a single alias? I haven't dug into the distribution of alias set sizes however. |
@TomAFrench if anything wrapping SmallVec in those collections should lead to more memory usage, not less. Unless I suppose if the sizes are similar we'd be saving space from not having an allocation header/metadata from the heap allocator. |
Oh, when I read |
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.
LGTM
This changes the memory profile two ways:
Instead of a symmetrical pyramid as in the baseline of #7053 we get a steeper descent, and the whole thing lasts just seconds compared to 30s originally. |
I'd need to think about it a little bit @jfecher. Good chance you're right and the fact we'd be putting it inside an enum would risk inflating the other variants. |
Description
Problem
Related to #7001
Summary
While pairing with Akosh on improving compilation memory usage he mentioned that he found that most alias sets had one element in them. I was curious if instead of using a
BTreeSet
of size one using an enum variant for that case would improve memory usage a bit, so that's what this PR does.Additional Context
Documentation
Check one:
PR Checklist
cargo fmt
on default settings.