Repository navigation
Conversation
🚀 Deploying Preview to Cloudflare 🚀Preview URL: https://perf-migrate-reuse-syntax-trees-viteplus-dev.voidzero-docs.workers.dev (commit f4993bc)This URL reflects your latest Preview deploymentPreview Deployments by commit
|
Contributor
CLI artifact sizes (
|
| Artifact | Format | Base | PR | Change |
|---|---|---|---|---|
packages/cli/dist |
Directory total | 2.21 MiB | 2.21 MiB | 0 B (0.00%) |
packages/core/dist |
Directory total | 4.08 MiB | 4.08 MiB | 0 B (0.00%) |
| Combined package dist | Directory total | 6.29 MiB | 6.29 MiB | 0 B (0.00%) |
vp (Linux x64) |
Binary | 11.42 MiB | 11.42 MiB | 0 B (0.00%) |
vp (Linux x64) |
gzip -9 | 4.93 MiB | 4.93 MiB | 0 B (0.00%) |
| NAPI (Linux x64) | Binary | 33.69 MiB | 33.69 MiB | 0 B (0.00%) |
| NAPI (Linux x64) | gzip -9 | 13.41 MiB | 13.41 MiB | +20 B (+0.00%) |
vp (macOS ARM64) |
Binary | 8.50 MiB | 8.50 MiB | 0 B (0.00%) |
vp (macOS ARM64) |
gzip -9 | 4.31 MiB | 4.31 MiB | 0 B (0.00%) |
| NAPI (macOS ARM64) | Binary | 40.96 MiB | 40.96 MiB | 0 B (0.00%) |
| NAPI (macOS ARM64) | gzip -9 | 17.64 MiB | 17.64 MiB | -21 B (-0.00%) |
vp (Windows x64) |
Binary | 9.29 MiB | 9.29 MiB | 0 B (0.00%) |
vp (Windows x64) |
gzip -9 | 4.05 MiB | 4.05 MiB | -1 B (-0.00%) |
| NAPI (Windows x64) | Binary | 29.53 MiB | 29.53 MiB | 0 B (0.00%) |
| NAPI (Windows x64) | gzip -9 | 12.03 MiB | 12.03 MiB | +233 B (+0.00%) |
| Trampoline (Windows x64) | Binary | 13.50 KiB | 13.50 KiB | 0 B (0.00%) |
| Trampoline (Windows x64) | gzip -9 | 7.09 KiB | 7.08 KiB | -3 B (-0.04%) |
| Installer (Windows x64) | Binary | 4.63 MiB | 4.63 MiB | 0 B (0.00%) |
| Installer (Windows x64) | gzip -9 | 2.17 MiB | 2.17 MiB | -1 B (-0.00%) |
This was referenced Oct 12, 2026
fengmk2
force-pushed
the
perf/migrate-reuse-syntax-trees
branch
from
October 13, 2026 17:04
989e9c4 to
f4993bc
Compare
fengmk2
marked this pull request as ready for review
October 14, 2026 03:42
cpojer
approved these changes
Oct 14, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Import migration parses each source file again for every rewrite rule. Most rules leave the file unchanged, so large projects repeat the same parsing work many times.
Reuse the syntax tree while the text and rule language stay unchanged. Parse again after each edit or language change. Rules still run in order, and later rules see all earlier edits.
Compare
mainatd74d7975bwith this PR atf4993bc49. The table shows median elapsed times from six alternating pairs on the same Linux runner. Both variants use thereleaseprofile, fat LTO, one codegen unit, and four Rayon threads.Each measurement starts a fresh process. The driver reads files before the timer starts to make filesystem cache conditions comparable. The timed work calls
rewrite_imports_in_directory, which includes file discovery, rule setup, reads, matching, and writes. It excludes compilation, dependency installation, and other migration phases. These percentages apply only to import rewriting.A separate diagnostic pass counts parser calls without affecting the timed binaries. First-pass counts are:
The Vitest group has 128 rules. A file with no edits needs one parse for that group instead of 128. All matcher attempts and replacement counts match between variants. Output hashes, changed-file lists, and warnings also match in every pair.
Benchmark run and raw results · Benchmark source · Individual samples and diagnostics