File tree Expand file tree Collapse file tree 3 files changed +5
-1
lines changed
Misc/NEWS.d/next/Core_and_Builtins Expand file tree Collapse file tree 3 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -142,6 +142,7 @@ typedef struct _optimization_stats {
142142 uint64_t recursive_call ;
143143 uint64_t low_confidence ;
144144 uint64_t unknown_callee ;
145+ uint64_t trace_immediately_deopts ;
145146 uint64_t executors_invalidated ;
146147 UOpStats opcode [PYSTATS_MAX_UOP_ID + 1 ];
147148 uint64_t unsupported_opcode [256 ];
Original file line number Diff line number Diff line change 1- Protect against specialization failures in the tracing JIT compiler.
1+ Protect against specialization failures in the tracing JIT compiler for performance reasons .
Original file line number Diff line number Diff line change @@ -620,8 +620,11 @@ _PyJit_translate_single_bytecode_to_trace(
620620 // in the instruction stream, but rather the deopt.
621621 // It's important we check for this, as some specializations might make
622622 // no progress (they can immediately deopt after specializing).
623+ // We do this to improve performance, as otherwise a compiled trace
624+ // will just deopt immediately.
623625 if (backoff != adaptive_counter_cooldown ().value_and_backoff &&
624626 backoff != trigger_backoff_counter ().value_and_backoff ) {
627+ OPT_STAT_INC (trace_immediately_deopts );
625628 opcode = _PyOpcode_Deopt [opcode ];
626629 }
627630 }
You can’t perform that action at this time.
0 commit comments