summaryrefslogtreecommitdiffstats
path: root/Python/ceval.c
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2007-11-07 02:45:46 (GMT)
committerRaymond Hettinger <python@rcn.com>2007-11-07 02:45:46 (GMT)
commitdc1d1ba9cfcb8dc1eea9b3960df2b0504ca92727 (patch)
treefa34a92d567afe1e0eeeefeefabdc8fd506981e8 /Python/ceval.c
parentcdcf887999524cb7ff5ba3cab129d04956333e0d (diff)
downloadcpython-dc1d1ba9cfcb8dc1eea9b3960df2b0504ca92727.zip
cpython-dc1d1ba9cfcb8dc1eea9b3960df2b0504ca92727.tar.gz
cpython-dc1d1ba9cfcb8dc1eea9b3960df2b0504ca92727.tar.bz2
Add build option for faster loop execution.
Diffstat (limited to 'Python/ceval.c')
-rw-r--r--Python/ceval.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/Python/ceval.c b/Python/ceval.c
index 245b08c..f86c4fc 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -2159,7 +2159,18 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
PREDICTED_WITH_ARG(JUMP_ABSOLUTE);
case JUMP_ABSOLUTE:
JUMPTO(oparg);
+#if FAST_LOOPS
+ /* Enabling this path speeds-up all while and for-loops by bypassing
+ the per-loop checks for signals. By default, this should be turned-off
+ because it prevents detection of a control-break in tight loops like
+ "while 1: pass". Compile with this option turned-on when you need
+ the speed-up and do not need break checking inside tight loops (ones
+ that contain only instructions ending with goto fast_next_opcode).
+ */
+ goto fast_next_opcode;
+#else
continue;
+#endif
case GET_ITER:
/* before: [obj]; after [getiter(obj)] */