@@ -99,8 +99,13 @@ backoff_counter_triggers(_Py_BackoffCounter counter)
9999// Must be larger than ADAPTIVE_COOLDOWN_VALUE, otherwise when JIT code is
100100// invalidated we may construct a new trace before the bytecode has properly
101101// re-specialized:
102- #define JUMP_BACKWARD_INITIAL_VALUE 4095
103- #define JUMP_BACKWARD_INITIAL_BACKOFF 12
102+ // Note: this should be a prime number-1. This increases the likelihood of
103+ // finding a "good" loop iteration to trace.
104+ // For example, 4095 does not work for the nqueens benchmark on pyperformanc
105+ // as we always end up tracing the loop iteration's
106+ // exhaustion iteration. Which aborts our current tracer.
107+ #define JUMP_BACKWARD_INITIAL_VALUE 4000
108+ #define JUMP_BACKWARD_INITIAL_BACKOFF 14
104109static inline _Py_BackoffCounter
105110initial_jump_backoff_counter (void )
106111{
@@ -112,7 +117,7 @@ initial_jump_backoff_counter(void)
112117 * Must be larger than ADAPTIVE_COOLDOWN_VALUE,
113118 * otherwise when a side exit warms up we may construct
114119 * a new trace before the Tier 1 code has properly re-specialized. */
115- #define SIDE_EXIT_INITIAL_VALUE 4095
120+ #define SIDE_EXIT_INITIAL_VALUE 4000
116121#define SIDE_EXIT_INITIAL_BACKOFF 12
117122
118123static inline _Py_BackoffCounter
0 commit comments