]> git.madduck.net Git - etc/vim.git/commitdiff

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

perf: drop the initial stack copy (#2670)
authorBatuhan Taskaya <isidentical@gmail.com>
Sun, 5 Dec 2021 21:03:48 +0000 (00:03 +0300)
committerGitHub <noreply@github.com>
Sun, 5 Dec 2021 21:03:48 +0000 (13:03 -0800)
Co-authored-by: Richard Si <63936253+ichard26@users.noreply.github.com>
CHANGES.md
src/blib2to3/pgen2/parse.py

index 097725ec0beebcda2c7cf3ac2cd89449f3c57d61..434f80980a5e88dd6bcc6cdec8769ece38107c80 100644 (file)
@@ -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
 
index 792e8e66698246f578fef7ce88d7bf69258af3e9..e5dad3ae76697124627e40c6601f0ef0bec97e5a 100644 (file)
@@ -53,7 +53,7 @@ class Recorder:
         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