Performance: Use SmallVec in rustfix
deeprobin opened this issue · 1 comments
I suggest using SmallVec
(smallvec
crate) instead of a regular Vec to improve performance, by having a SmallVec allocate primarily on the stack and the heap is secondary.
Where this could be useful
Lines 28 to 29 in ae9b645
Lines 65 to 66 in ae9b645
Line 72 in ae9b645
Lines 33 to 34 in ae9b645
Line 107 in ae9b645
Line 131 in ae9b645
Line 191 in ae9b645
Line 163 in ae9b645
Of course, it doesn't make sense to blindly replace something like that, but you could analyze this with benchmarks to see where a SmallVec would make sense.
Additional/useful resources
I'm going to close as I don't think performance has been much of a concern.