aboutsummaryrefslogtreecommitdiff
path: root/Misc
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2024-05-28 22:47:45 +0200
committerGitHub <noreply@github.com>2024-05-28 22:47:45 +0200
commit0d0be6b3efeace4743329f81c08f9720cc221207 (patch)
treeafeec3b81a48161eef6c675658a9e7aac55aaf36 /Misc
parent[3.13] gh-119011: `type.__type_params__` now return an empty tuple (GH-119296... (diff)
downloadcpython-0d0be6b3efeace4743329f81c08f9720cc221207.tar.gz
cpython-0d0be6b3efeace4743329f81c08f9720cc221207.tar.bz2
cpython-0d0be6b3efeace4743329f81c08f9720cc221207.zip
[3.13] gh-119118: Fix performance regression in tokenize module (GH-119615) (#119682)
- Cache line object to avoid creating a Unicode object for all of the tokens in the same line. - Speed up byte offset to column offset conversion by using the smallest buffer possible to measure the difference. (cherry picked from commit d87b0151062e36e67f9e42e1595fba5bf23a485c) Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com> Co-authored-by: Pablo Galindo <pablogsal@gmail.com>
Diffstat (limited to 'Misc')
-rw-r--r--Misc/NEWS.d/next/Library/2024-05-28-12-15-03.gh-issue-119118.FMKz1F.rst2
1 files changed, 2 insertions, 0 deletions
diff --git a/Misc/NEWS.d/next/Library/2024-05-28-12-15-03.gh-issue-119118.FMKz1F.rst b/Misc/NEWS.d/next/Library/2024-05-28-12-15-03.gh-issue-119118.FMKz1F.rst
new file mode 100644
index 00000000000..3cf61662fe7
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2024-05-28-12-15-03.gh-issue-119118.FMKz1F.rst
@@ -0,0 +1,2 @@
+Fix performance regression in the :mod:`tokenize` module by caching the ``line``
+token attribute and calculating the column offset more efficiently.