perf: outline and make reserve as cold - #562
Conversation
|
I have the intuition that benchmarks are no more reliable than coin flips it makes sense that marking it as cold makes it faster, and std also does it I side on making it cold but why add new methods?? just keep the existing ones and add |
|
I think there are instances that we want to inline the reserve when we are sure that we need that extra space, or maybe call the reserve in another inline(never) function which it will be not wise to outline the action once again. |
|
it makes sense, but we are adding too many functions for something so simple is there any way we can do that without having to make a whole new function but just with an attribute?? also, the cold function does not do the check |
|
Give me some time to think about it. the |
|
Another note if we move |
|
alright I made up my mind, I think this is my stance for now https://github.com/servo/rust-smallvec/wiki/on-v2%E2%80%90alpha-performance-contributions I'll recover this PR if applicable by then in beta, though push concerns me |
This outlines and mark reserve as cold as it rarely happens during execution of a program.
It helps both with performance and binary size.
Benchmarks results are mixed, some improvements and some regressions, but overall as rust standard library does this too, I think these changes are good for the project: