Skip to content

Reduce repeated scope walks in the minifier#22

Merged
alvinwan merged 3 commits intomainfrom
dev/alvin/speed-optimization-2
Apr 8, 2026
Merged

Reduce repeated scope walks in the minifier#22
alvinwan merged 3 commits intomainfrom
dev/alvin/speed-optimization-2

Conversation

@alvinwan
Copy link
Copy Markdown
Owner

@alvinwan alvinwan commented Apr 8, 2026

Summary

  • cache per-scope binding and reserved-name analysis inside VariableShortener
  • reuse that cached analysis for both _scope_bindings and _local_scope_state
  • localize fix_missing_locations to appended public alias statements instead of rescanning the whole tree

Validation

  • .venv/bin/python -m pytest -q
  • git diff --check

Notes

  • I tested a few additional reserved-name optimizations locally and dropped them because they regressed end-to-end package timings; this PR keeps only the changes that held up cleanly.

@alvinwan alvinwan marked this pull request as ready for review April 8, 2026 08:14
@alvinwan alvinwan merged commit 97f2911 into main Apr 8, 2026
10 checks passed
@alvinwan alvinwan deleted the dev/alvin/speed-optimization-2 branch April 8, 2026 08:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant