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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf: drop the initial stack copy #2670

Merged
merged 3 commits into from Dec 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGES.md
Expand Up @@ -26,6 +26,8 @@
- Fix styling of starred expressions inside `match` subject (#2667)
- Fix parser error location on invalid syntax in a `match` statement (#2649)
- Fix Python 3.10 support on platforms without ProcessPoolExecutor (#2631)
- Improve parsing performance on code that uses `match` under `--target-version py310`
up to ~50% (#2670)

### Packaging

Expand Down
2 changes: 1 addition & 1 deletion src/blib2to3/pgen2/parse.py
Expand Up @@ -53,7 +53,7 @@ def __init__(self, parser: "Parser", ilabels: List[int], context: Context) -> No
self.context = context # not really matter

self._dead_ilabels: Set[int] = set()
self._start_point = copy.deepcopy(self.parser.stack)
self._start_point = self.parser.stack
self._points = {ilabel: copy.deepcopy(self._start_point) for ilabel in ilabels}

@property
Expand Down