Skip to content

Commit 0aeba96

Browse files
committed
Rename counter
1 parent f89efae commit 0aeba96

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

Include/internal/pycore_interp_structs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -953,7 +953,7 @@ struct _is {
953953
struct _PyExecutorObject *executor_deletion_list_head;
954954
struct _PyExecutorObject *cold_executor;
955955
int executor_deletion_list_remaining_capacity;
956-
size_t trace_run_counter;
956+
size_t executor_creation_counter;
957957
_rare_events rare_events;
958958
PyDict_WatchCallback builtins_dict_watcher;
959959

Include/internal/pycore_optimizer.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,8 @@ PyAPI_FUNC(void) _Py_Executors_InvalidateCold(PyInterpreterState *interp);
115115
#endif
116116

117117
// Used as the threshold to trigger executor invalidation when
118-
// trace_run_counter is greater than this value.
119-
// TODO: Test what should be the optimal value for this.
118+
// executor_creation_counter is greater than this value.
119+
// This value is arbitrary and was not optimized.
120120
#define JIT_CLEANUP_THRESHOLD 1000
121121

122122
// This is the length of the trace we project initially.

Python/ceval_gil.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1398,7 +1398,7 @@ _Py_HandlePending(PyThreadState *tstate)
13981398
if ((breaker & _PY_EVAL_JIT_INVALIDATE_COLD_BIT) != 0) {
13991399
_Py_unset_eval_breaker_bit(tstate, _PY_EVAL_JIT_INVALIDATE_COLD_BIT);
14001400
_Py_Executors_InvalidateCold(tstate->interp);
1401-
tstate->interp->trace_run_counter = JIT_CLEANUP_THRESHOLD;
1401+
tstate->interp->executor_creation_counter = JIT_CLEANUP_THRESHOLD;
14021402
}
14031403

14041404
/* GIL drop request */

Python/optimizer.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1327,7 +1327,7 @@ uop_optimize(
13271327
// Check executor coldness
13281328
PyThreadState *tstate = PyThreadState_Get();
13291329
// It's okay if this ends up going negative.
1330-
if (--tstate->interp->trace_run_counter == 0) {
1330+
if (--tstate->interp->executor_creation_counter == 0) {
13311331
_Py_set_eval_breaker_bit(tstate, _PY_EVAL_JIT_INVALIDATE_COLD_BIT);
13321332
}
13331333

Python/pystate.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,7 @@ init_interpreter(PyInterpreterState *interp,
574574
interp->executor_list_head = NULL;
575575
interp->executor_deletion_list_head = NULL;
576576
interp->executor_deletion_list_remaining_capacity = 0;
577-
interp->trace_run_counter = JIT_CLEANUP_THRESHOLD;
577+
interp->executor_creation_counter = JIT_CLEANUP_THRESHOLD;
578578
if (interp != &runtime->_main_interpreter) {
579579
/* Fix the self-referential, statically initialized fields. */
580580
interp->dtoa = (struct _dtoa_state)_dtoa_state_INIT(interp);

0 commit comments

Comments
 (0)