summaryrefslogtreecommitdiffstats
path: root/Tools
diff options
context:
space:
mode:
authorMark Shannon <mark@hotpy.org>2022-06-20 12:00:42 (GMT)
committerGitHub <noreply@github.com>2022-06-20 12:00:42 (GMT)
commitab0e60101637b7cf47f3cc95813996791e7118c4 (patch)
treec0590854ab9e9137c872f0789763d7bb07151fb0 /Tools
parent45e62a2bc1c0000e2e9b613fff6bebf2c26fcb93 (diff)
downloadcpython-ab0e60101637b7cf47f3cc95813996791e7118c4.zip
cpython-ab0e60101637b7cf47f3cc95813996791e7118c4.tar.gz
cpython-ab0e60101637b7cf47f3cc95813996791e7118c4.tar.bz2
GH-93516: Speedup line number checks when tracing. (GH-93763)
* Use a lookup table to reduce overhead of getting line numbers during tracing.
Diffstat (limited to 'Tools')
-rw-r--r--Tools/scripts/deepfreeze.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/Tools/scripts/deepfreeze.py b/Tools/scripts/deepfreeze.py
index de8fde4..b2d091a 100644
--- a/Tools/scripts/deepfreeze.py
+++ b/Tools/scripts/deepfreeze.py
@@ -254,6 +254,7 @@ class Printer:
self.write(f".co_exceptiontable = {co_exceptiontable},")
self.field(code, "co_flags")
self.write(".co_warmup = QUICKENING_INITIAL_WARMUP_VALUE,")
+ self.write("._co_linearray_entry_size = 0,")
self.field(code, "co_argcount")
self.field(code, "co_posonlyargcount")
self.field(code, "co_kwonlyargcount")
@@ -271,6 +272,7 @@ class Printer:
self.write(f".co_name = {co_name},")
self.write(f".co_qualname = {co_qualname},")
self.write(f".co_linetable = {co_linetable},")
+ self.write("._co_linearray = NULL,")
self.write(f".co_code_adaptive = {co_code_adaptive},")
for i, op in enumerate(code.co_code[::2]):
if op == RESUME: