oxc icon indicating copy to clipboard operation
oxc copied to clipboard

feat(ast): add a dummy `node_id` field to all visitable AST types.

Open rzvxa opened this issue 1 year ago • 6 comments

Part of #5689

A few places are creating these nodes without AstBuilder; For now I've assigned them directly but should be taken care of as part of making types non_exhaustive.

rzvxa avatar Sep 14 '24 21:09 rzvxa

Your org has enabled the Graphite merge queue for merging into main

Add the label “0-merge” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge. Or use the label “hotfix” to add to the merge queue as a hot fix.

You must have a Graphite account and log in to Graphite in order to use the merge queue. Sign up using this link.

graphite-app[bot] avatar Sep 14 '24 21:09 graphite-app[bot]

[!WARNING] This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite. Learn more

  • #5776 Graphite
  • #5775 Graphite 👈
  • #5774 Graphite
  • main

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @rzvxa and the rest of your teammates on Graphite Graphite

rzvxa avatar Sep 14 '24 21:09 rzvxa

CodSpeed Performance Report

Merging oxc-project/oxc#5775 will degrade performances by 3.87%

Comparing 09-15-feat_ast_add_a_dummy_node_id_field_to_all_visitable_ast_types (f5344f9) with 09-15-fix_ast_tools_fix_miscalculation_of_enum_layouts (ea1c733)

Summary

❌ 4 regressions ✅ 25 untouched benchmarks

:warning: Please fix the performance issues or acknowledge them on CodSpeed.

Benchmarks breakdown

Benchmark 09-15-fix_ast_tools_fix_miscalculation_of_enum_layouts 09-15-feat_ast_add_a_dummy_node_id_field_to_all_visitable_ast_types Change
codegen[checker.ts] 20.8 ms 21.7 ms -3.87%
isolated-declarations[vue-id.ts] 391.8 ms 404.8 ms -3.19%
parser[RadixUIAdoptionSection.jsx] 77.3 µs 79.7 µs -3.04%
parser[cal.com.tsx] 24.5 ms 25.2 ms -3.08%

codspeed-hq[bot] avatar Sep 14 '24 21:09 codspeed-hq[bot]

CodSpeed Performance Report

Merging oxc-project/oxc#5775 will degrade performances by 3.87%

Comparing 09-15-feat_ast_add_a_dummy_node_id_field_to_all_visitable_ast_types (00ce823) with 09-15-fix_ast_tools_fix_miscalculation_of_enum_layouts (ea1c733)

Summary

❌ 3 regressions ✅ 26 untouched benchmarks

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Benchmarks breakdown

Benchmark 09-15-fix_ast_tools_fix_miscalculation_of_enum_layouts 09-15-feat_ast_add_a_dummy_node_id_field_to_all_visitable_ast_types Change ❌ codegen[checker.ts] 20.8 ms 21.7 ms -3.87% ❌ isolated-declarations[vue-id.ts] 391.8 ms 404.7 ms -3.17% ❌ parser[cal.com.tsx] 24.5 ms 25.2 ms -3.07%

Not bad!!

Boshen avatar Sep 15 '24 03:09 Boshen

A few places are creating these nodes without AstBuilder; For now I've assigned them directly but should be taken care of as part of making types non_exhaustive.

I cleaned up the parser a few days, let me ask @Dunqing to refactor the transformer 😀

Let's do non_exhaustive first https://github.com/oxc-project/oxc/pull/5778

Boshen avatar Sep 15 '24 03:09 Boshen

Merging oxc-project/oxc#5775 will degrade performances by 3.87%

Not bad!!

We can win most of this perf back if we optimize field layouts later on.

overlookmotel avatar Sep 16 '24 12:09 overlookmotel