oxc/crates
overlookmotel 20679d1e1e
perf(parser): pad Token to 16 bytes (#2211)
Counter-intuitively, it seems that *increasing* the size of `Token`
improves performance slightly.

This appears to be because when `Token` is 16 bytes, copying `Token` is
a single 16-byte load/store. At present, it's 12 bytes which requires an
8-byte load/store + a 4-byte load/store.

https://godbolt.org/z/KPYsn3ab7

This suggests that either:

1. #2010 could be reverted at no cost, and the overhead of the hash
table removed.
or:
2. We need to get `Token` down to 8 bytes!

I have an idea how to *maybe* do (2), so I'd suggest leaving it as is
for now until I've been able to research that.

NB I also tried putting `#[repr(align(16))]` on `Token` so that copying
uses aligned loads/stores. That [hurt the benchmarks very
slightly](https://codspeed.io/overlookmotel/oxc/branches/lexer-pad-token),
though it might produce a gain on architectures where unaligned loads
are more expensive (ARM64 I think?). But I can't test that theory, so
have left it out.
2024-01-30 11:47:26 +08:00
..
oxc Publish crates v0.5.0 2024-01-12 23:33:47 +08:00
oxc_allocator docs(allocator): document behaviour of Box 2024-01-29 21:34:45 +08:00
oxc_ast refactor(semantic): checking label in ContinueStatement based on LabelBuilder (#2202) 2024-01-29 18:24:42 +08:00
oxc_cli feat(cli): add --version (#2182) 2024-01-26 19:13:17 +08:00
oxc_codegen feat(codegen): print TemplateLiteral with print_str (#2207) 2024-01-29 23:09:29 +08:00
oxc_diagnostics refactor: move all miette usages to oxc_diagnostics 2024-01-28 16:52:16 +08:00
oxc_index Publish crates v0.5.0 2024-01-12 23:33:47 +08:00
oxc_js_regex
oxc_language_server chore(deps): update cargo (#2191) 2024-01-29 11:38:47 +08:00
oxc_linter feat(linter): implement @next/next/no-before-interactive-script-outsi… (#2203) 2024-01-29 21:01:50 +08:00
oxc_macros feat(linter): remove the --timings feature (#2049) 2024-01-16 14:21:04 +08:00
oxc_minifier feat(codegen): move string test to codegen (#2150) 2024-01-23 23:49:36 +08:00
oxc_parser perf(parser): pad Token to 16 bytes (#2211) 2024-01-30 11:47:26 +08:00
oxc_prettier fix(codegen): print Directive original string (#2157) 2024-01-25 15:24:05 +08:00
oxc_semantic refactor(semantic): get function by scope_id in set_function_node_flag (#2208) 2024-01-30 11:43:35 +08:00
oxc_span Publish crates v0.5.0 2024-01-12 23:33:47 +08:00
oxc_syntax refactor(syntax): don't re-export unicode_id_start 2024-01-23 11:05:17 +08:00
oxc_transformer feat(transformer/decorators): support transform member decorators (#2171) 2024-01-26 10:14:19 +08:00
oxc_wasm refactor(linter): perfect the scope linter (#2092) 2024-01-20 10:46:35 +08:00