oxc/crates/oxc_codegen/src
overlookmotel 12a7607bac perf(codegen): inline Codegen::print_list (#5221)
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.
2024-08-26 10:28:49 +00:00
..
annotation_comment.rs fix(codegen): do not print comments when --minify 2024-08-24 13:49:34 +08:00
binary_expr_visitor.rs feat(codegen)!: remove const generic MINIFY (#5001) 2024-08-20 08:13:27 +00:00
context.rs feat(codegen): align operator precedence with esbuild (#4509) 2024-07-28 11:48:51 +00:00
gen.rs refactor(codegen): rename vars (#5222) 2024-08-26 08:40:50 +00:00
lib.rs perf(codegen): inline Codegen::print_list (#5221) 2024-08-26 10:28:49 +00:00
operator.rs feat(codegen): move minifying printer to codegen crate (#985) 2023-10-12 14:56:30 +08:00
sourcemap_builder.rs perf(codegen): reduce size of LineOffsetTable (#4643) 2024-08-06 01:08:12 +00:00