mirror of
https://github.com/danbulant/oxc
synced 2026-05-24 12:21:58 +00:00
Revert #5192 and add a comment that it's not a perf gain. This was really surprising to me, but the benchmarks do demonstrate it. Please see the benchmarks commit-by-commit on this PR. Adding `#[inline]` to the function does give +1% gain, but it's no better than it was before #5192. So I think preferable to just revert to the simpler original. I think likely explanation is that the compiler is already performing this optimization itself. And if it does it itself, then it understands the code better, and can then make better decisions about inlining. https://godbolt.org/z/xzhWWeMoe seems to demonstrate this - there are 2 calls to `Item::gen` in the generated assembly, so it has split the loop into 2. |
||
|---|---|---|
| .. | ||
| annotation_comment.rs | ||
| binary_expr_visitor.rs | ||
| context.rs | ||
| gen.rs | ||
| lib.rs | ||
| operator.rs | ||
| sourcemap_builder.rs | ||