Skip to content

Commit 7661e7b

Browse files
Reduce ENTER_EXECUTOR's exit quality
1 parent 64f3468 commit 7661e7b

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

Include/internal/pycore_optimizer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ extern "C" {
3737
/* Exit quality thresholds: trace stops when fitness < exit_quality.
3838
* Higher = trace is more willing to stop here. */
3939
#define EXIT_QUALITY_CLOSE_LOOP (FITNESS_INITIAL - AVG_SLOTS_PER_INSTRUCTION*4)
40-
#define EXIT_QUALITY_ENTER_EXECUTOR (FITNESS_INITIAL * 3 / 8)
40+
#define EXIT_QUALITY_ENTER_EXECUTOR (FITNESS_INITIAL * 1 / 8)
4141
#define EXIT_QUALITY_DEFAULT (FITNESS_INITIAL / 8)
4242
#define EXIT_QUALITY_SPECIALIZABLE (FITNESS_INITIAL / 80)
4343

Modules/_testinternalcapi/test_cases.c.h

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Python/bytecodes.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3455,7 +3455,7 @@ dummy_func(
34553455
int og_oparg = (oparg & ~255) | executor->vm_data.oparg;
34563456
next_instr = this_instr;
34573457
if (_PyJit_EnterExecutorShouldStopTracing(og_opcode)) {
3458-
if (_PyOpcode_Caches[_PyOpcode_Deopt[opcode]]) {
3458+
if (_PyOpcode_Caches[_PyOpcode_Deopt[og_opcode]]) {
34593459
PAUSE_ADAPTIVE_COUNTER(this_instr[1].counter);
34603460
}
34613461
opcode = og_opcode;

Python/generated_cases.c.h

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Python/optimizer.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,7 @@ compute_exit_quality(_Py_CODEUNIT *target_instr, int opcode,
617617
if (target_instr == tracer->initial_state.close_loop_instr) {
618618
return EXIT_QUALITY_CLOSE_LOOP;
619619
}
620-
else if (target_instr->op.code == ENTER_EXECUTOR && !_PyJit_EnterExecutorShouldStopTracing(opcode)) {
620+
else if (target_instr->op.code == ENTER_EXECUTOR) {
621621
return EXIT_QUALITY_ENTER_EXECUTOR;
622622
}
623623
else if (opcode == JUMP_BACKWARD_JIT ||

0 commit comments

Comments
 (0)