perf(allocator): mark ReplaceWith panic path cold#24515
Conversation
ReplaceWith panic path cold
Merging this PR will not alter performance
Comparing Footnotes
|
|
I don't think this makes any difference. And, as far as I know, But why What is Mr Codex telling you? |
|
Oh actually, I'm pretty sure this cannot account for the perf drop. Our benchmarks are built with Whether it's a good idea regardless, I don't fully know. I don't think so. But I imagine you have info that contradicts my assumptions, which motivated this PR. I'd like to know what it is! |
See my msg in Gchat for the actual replace with perf problem. This was unrelated that i noticed, from my (admittedly limited understanding) For cold:
whereas inline never just discourages inlining. But, both of these are just suggestions to the compiler! |
Merge activity
|
## Summary Mark ReplaceWith's write_dummy helper as cold. The helper is only reached while unwinding from a panic in a replacer closure. Telling the optimizer that this path is cold helps keep its allocator and dummy-construction code out of hot code layout and improves inlining decisions in unwind builds.
64d70f7 to
7ca9575
Compare
Summary
Mark ReplaceWith's write_dummy helper as cold.
The helper is only reached while unwinding from a panic in a replacer closure. Telling the optimizer that this path is cold helps keep its allocator and dummy-construction code out of hot code layout and improves inlining decisions in unwind builds.