Skip to content

perf(es/typescript): reduce visitor overhead in ts transform#11535

Draft
kdy1 wants to merge 1 commit intomainfrom
kdy1/perf-ts
Draft

perf(es/typescript): reduce visitor overhead in ts transform#11535
kdy1 wants to merge 1 commit intomainfrom
kdy1/perf-ts

Conversation

@kdy1
Copy link
Copy Markdown
Member

@kdy1 kdy1 commented Feb 7, 2026

Summary

  • switch TSX wrapper from VisitMut adapter to direct Pass implementation
  • keep pragma usage collection in a lightweight pre-step and run core transform directly
  • remove redundant namespace block pre-strip call to avoid duplicate work
  • add focused unit tests for JSX id extraction/comment span helper and member-key template handling

Testing

  • cargo fmt --all
  • cargo test -p swc_ecma_transforms_typescript -p swc_ecma_transforms_react -p swc_ecma_transforms
  • cargo test -p swc --test projects --test tsc

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Feb 7, 2026

⚠️ No Changeset found

Latest commit: 97ac282

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@kdy1 kdy1 added this to the Planned milestone Feb 7, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 7, 2026

Binary Sizes

File Size
swc.linux-x64-gnu.node 28M (28576200 bytes)

Commit: 9cc5796

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Feb 7, 2026

Merging this PR will improve performance by 2.08%

⚡ 1 improved benchmark
✅ 183 untouched benchmarks

Performance Changes

Benchmark BASE HEAD Efficiency
es/minifier/libs/terser 376.4 ms 368.8 ms +2.08%

Comparing kdy1/perf-ts (97ac282) with main (b7e87c7)

Open in CodSpeed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant