Skip to content

Commit b52ec78

Browse files
committed
Issue python#4753: By enabling a configure option named '--with-computed-gotos'
on compilers that support it (notably: gcc, SunPro, icc), the bytecode evaluation loop is compiled with a new dispatch mechanism which gives speedups of up to 20%, depending on the system, on various benchmarks.
1 parent e6aad75 commit b52ec78

File tree

8 files changed

+6347
-4994
lines changed

8 files changed

+6347
-4994
lines changed

Makefile.pre.in

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,16 @@ ASDLGEN= $(srcdir)/Parser/asdl_c.py
247247

248248
##########################################################################
249249
# Python
250+
251+
OPCODETARGETS_H= \
252+
$(srcdir)/Python/opcode_targets.h
253+
254+
OPCODETARGETGEN= \
255+
$(srcdir)/Python/makeopcodetargets.py
256+
257+
OPCODETARGETGEN_FILES= \
258+
$(OPCODETARGETGEN) $(srcdir)/Lib/opcode.py
259+
250260
PYTHON_OBJS= \
251261
Python/_warnings.o \
252262
Python/Python-ast.o \
@@ -567,6 +577,11 @@ Objects/unicodeobject.o: $(srcdir)/Objects/unicodeobject.c \
567577
$(BYTESTR_DEPS) \
568578
$(srcdir)/Objects/stringlib/formatter.h
569579

580+
$(OPCODETARGETS_H): $(OPCODETARGETGEN_FILES)
581+
$(OPCODETARGETGEN) $(OPCODETARGETS_H)
582+
583+
Python/ceval.o: $(OPCODETARGETS_H)
584+
570585
Python/formatter_unicode.o: $(srcdir)/Python/formatter_unicode.c \
571586
$(BYTESTR_DEPS)
572587

Misc/NEWS

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ What's New in Python 3.1 alpha 0
1212
Core and Builtins
1313
-----------------
1414

15+
- Issue #4753: By enabling a configure option named '--with-computed-gotos'
16+
on compilers that support it (notably: gcc, SunPro, icc), the bytecode
17+
evaluation loop is compiled with a new dispatch mechanism which gives
18+
speedups of up to 20%, depending on the system, on various benchmarks.
19+
1520
- Issue #4874: Most builtin decoders now reject unicode input.
1621

1722
- Issue #4842: Don't allow trailing 'L' when constructing an integer

0 commit comments

Comments
 (0)