Worse perf with NonZero
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
In https://github.com/rust-lang/literal-escaper/pull/15 I introduced NonZero into literal-escaper, but noticed perf regressions (on ARM).
On compiler explorer I noticed x86_64 asm differences that seem to indicate there may be a difference in inlining behavior: asm being generated without code differences in the surrounding code (does that not mean it is dead?). These can indeed be removed by uncommenting the commented #[inline] directives (top left pane). On arm, the changes are similar but more extensive and I can't tell whether extra function code is called or not.
Sprinkling the right #[inline] directives does remove the perf regressions on ARM. I haven't been able to do perf measurements on x86_64 yet.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with rust-lang/literal-escaper PR #15 and compare the compiler-explorer assembly in the linked x86_64 example, including the commented #[inline] directives. Investigate the corresponding ARM output and verify whether the generated extra function code is called or dead. Done means identifying the cause of the regression and confirming the effect with performance measurements on ARM and, if possible, x86_64.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers, performance
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100