-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
bpo-37146: Deactivate opcode cache only when using huntrleaks in the test suite #24643
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
0c0f5d8
c11e70f
a9680bc
2356931
68b0f83
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
…test suite
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -107,17 +107,16 @@ static long dxp[256]; | |
#endif | ||
|
||
/* per opcode cache */ | ||
#ifdef Py_DEBUG | ||
// --with-pydebug is used to find memory leak. opcache makes it harder. | ||
// So we disable opcache when Py_DEBUG is defined. | ||
// See bpo-37146 | ||
#define OPCACHE_MIN_RUNS 0 /* disable opcache */ | ||
#else | ||
#define OPCACHE_MIN_RUNS 1024 /* create opcache when code executed this time */ | ||
#endif | ||
static int opcache_min_runs = 1024; /* create opcache when code executed this time */ | ||
pablogsal marked this conversation as resolved.
Show resolved
Hide resolved
|
||
#define OPCODE_CACHE_MAX_TRIES 20 | ||
#define OPCACHE_STATS 0 /* Enable stats */ | ||
|
||
void | ||
pablogsal marked this conversation as resolved.
Show resolved
Hide resolved
|
||
_PyEval_DeactivateOpCache() | ||
pablogsal marked this conversation as resolved.
Show resolved
Hide resolved
|
||
{ | ||
opcache_min_runs = 0; | ||
} | ||
|
||
#if OPCACHE_STATS | ||
static size_t opcache_code_objects = 0; | ||
static size_t opcache_code_objects_extra_mem = 0; | ||
|
@@ -1705,9 +1704,9 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, PyFrameObject *f, int throwflag) | |
f->f_stackdepth = -1; | ||
f->f_state = FRAME_EXECUTING; | ||
|
||
if (co->co_opcache_flag < OPCACHE_MIN_RUNS) { | ||
if (co->co_opcache_flag < opcache_min_runs) { | ||
co->co_opcache_flag++; | ||
if (co->co_opcache_flag == OPCACHE_MIN_RUNS) { | ||
if (co->co_opcache_flag == opcache_min_runs) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This may increase memory access in hot path. Would you run pypeformance to ensure no performance regression? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sure, will run this over the weekend. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Seems that there is no much different over the noise level:
|
||
if (_PyCode_InitOpcache(co) < 0) { | ||
goto exit_eval_frame; | ||
} | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.