Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(es): Use into for AST construction #9197

Merged
merged 28 commits into from
Jul 10, 2024
Merged

Conversation

kdy1
Copy link
Member

@kdy1 kdy1 commented Jul 10, 2024

Description:

This PR changes the AST node construction code to use .into() or ::from() to make changing the boxed-ness of the AST node easier. I used ast-grep to make large changes across codebase.

@kdy1 kdy1 added this to the Planned milestone Jul 10, 2024
@kdy1 kdy1 self-assigned this Jul 10, 2024
@kdy1 kdy1 marked this pull request as ready for review July 10, 2024 13:41
@kdy1 kdy1 requested review from a team as code owners July 10, 2024 13:42
@kdy1 kdy1 merged commit 728417c into swc-project:perf Jul 10, 2024
144 of 148 checks passed
@kdy1 kdy1 deleted the ast-grep branch July 10, 2024 13:57
Copy link

codspeed-hq bot commented Jul 10, 2024

CodSpeed Performance Report

Merging #9197 will degrade performances by 9.3%

Comparing kdy1:ast-grep (cdcfb9a) with main (e3eb197)

Summary

⚡ 73 improvements
❌ 1 regressions
✅ 99 untouched benchmarks

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

Benchmarks breakdown

Benchmark main kdy1:ast-grep Change
es/full/bugs-1 606.9 µs 669.1 µs -9.3%
es/full/base/resolver_and_hygiene 506.2 µs 324.1 µs +56.18%
es/full/parser 1.7 ms 1.6 ms +9.25%
deserialization of serde 2.8 µs 2.7 µs +4.22%
serialization of serde 3.2 µs 3 µs +5.88%
bootstrap 77.3 ms 74.7 ms +3.39%
css/visitor/compare/clone 7.6 ms 6.8 ms +11.43%
css/visitor/compare/fold_span 9.6 ms 8.6 ms +11.45%
css/visitor/compare/fold_span_panic 9.9 ms 8.6 ms +15.13%
css/visitor/compare/visit_mut_span 8.1 ms 7.2 ms +11.27%
css/visitor/compare/visit_mut_span_panic 8.1 ms 7.2 ms +12.47%
css/parser/tailwind_3_1_1 9.3 ms 8.9 ms +4.2%
es/visitor/compare/clone 7.7 ms 7.3 ms +4.84%
es/visitor/compare/fold_span 10.7 ms 10.2 ms +4.55%
es/visitor/compare/fold_span_panic 10.8 ms 10.1 ms +6.65%
es/visitor/compare/visit_mut_span 8.2 ms 7.8 ms +4.82%
es/visitor/compare/visit_mut_span_panic 8.3 ms 7.8 ms +5.62%
es/parser/angular 38.6 ms 37.1 ms +4.09%
es/parser/backbone 5.8 ms 5.5 ms +4.93%
es/parser/cal-com 114.7 ms 108.5 ms +5.7%
... ... ... ... ...

ℹ️ Only the first 20 benchmarks are displayed. Go to the app to view all benchmarks.

kdy1 added a commit that referenced this pull request Jul 12, 2024
**Description:**

This PR changes the AST node construction code to use `.into()` or `::from()` to make changing the boxed-ness of the AST node easier. I used `ast-grep` to make large changes across codebase.
kdy1 added a commit that referenced this pull request Jul 12, 2024
**Description:**

This PR changes the AST node construction code to use `.into()` or `::from()` to make changing the boxed-ness of the AST node easier. I used `ast-grep` to make large changes across codebase.
@kdy1 kdy1 modified the milestones: Planned, v1.7.0 Jul 17, 2024
@swc-project swc-project locked as resolved and limited conversation to collaborators Aug 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant