Skip to content

Commit

Permalink
perf: drop the initial stack copy (#2670)
Browse files Browse the repository at this point in the history
Co-authored-by: Richard Si <63936253+ichard26@users.noreply.github.com>
  • Loading branch information
isidentical and ichard26 committed Dec 5, 2021
1 parent d9eee31 commit 28ab82a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
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

0 comments on commit 28ab82a

Please sign in to comment.