[PERF EXPERIMENT] Use a SmallVec for item paths (Vec<Symbol>s) - #157629
[PERF EXPERIMENT] Use a SmallVec for item paths (Vec<Symbol>s)#157629yotamofek wants to merge 1 commit into
SmallVec for item paths (Vec<Symbol>s)#157629Conversation
Checked the average size of all dropped `ItemPath`s when `x perf` is run, the average is 3.1 elements. So use a `SmallVec` with room for 4 inline elems, since it takes up 24 bytes for either 3 or 4.
|
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
[PERF EXPERIMENT] Use a `SmallVec` for item paths (`Vec<Symbol>`s)
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (6b15d7d): comparison URL. Overall result: ✅ improvements - no action neededBenchmarking means the PR may be perf-sensitive. Consider adding rollup=never if this change is not fit for rolling up. @rustbot label: -S-waiting-on-perf -perf-regression Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)This perf run didn't have relevant results for this metric. CyclesResults (secondary -2.5%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeThis perf run didn't have relevant results for this metric. Bootstrap: 517.707s -> 517.743s (0.01%) |
|
@GuillaumeGomez probably not worth it, right? |
|
Not really indeed. ^^' Isn't there a way to have a similar approach without the need for all the conversions? |
|
We could just use |
| } | ||
| } | ||
|
|
||
| impl<'a> IntoIterator for &'a ItemPath { |
There was a problem hiding this comment.
Since we have deref implemented already, do we need to have this IntoIterator implementation?
|
Hum... Maybe build a bit more on top of this to see if we can get more out of this newtype? If the performance improvement is bigger, it's much simpler to accept this newtype with its implementations. |
Checked the average size of all dropped
ItemPaths whenx perfis run, the average is 3.1 elements.So use a
SmallVecwith room for 4 inline elems, since it takes up 24 bytes for either 3 or 4.