gh-103533: Use pep669 APIs for cprofile#103534
Conversation
use the profiler tool id
|
@ericsnowcurrently how can I declare a global constant table in the module? |
Sorry, something went wrong.
Is it a new table or is it an existing one you're trying to convert? Does it have objects in it? Is the data actually const? |
Sorry, something went wrong.
It's a new, pure C, true const table. static const CallbackTableEntry callback_table[] = {
{PY_MONITORING_EVENT_PY_START, "_pystart_callback"},
{PY_MONITORING_EVENT_PY_RESUME, "_pystart_callback"},
{PY_MONITORING_EVENT_PY_RETURN, "_pyreturn_callback"},
{PY_MONITORING_EVENT_PY_YIELD, "_pyreturn_callback"},
{PY_MONITORING_EVENT_PY_UNWIND, "_pyreturn_callback"},
{PY_MONITORING_EVENT_CALL, "_ccall_callback"},
{PY_MONITORING_EVENT_C_RETURN, "_creturn_callback"},
{PY_MONITORING_EVENT_C_RAISE, "_creturn_callback"},
{0, NULL}
}; |
Sorry, something went wrong.
|
The situation is almost identical to |
Sorry, something went wrong.
|
Hi @markshannon , do you think this is a good candidate for 3.12? We pushed out PEP 699 but none of the standard library actually uses it. The profiling tool change is simpler than the debugging tool, so maybe this could be an example/try out for implementing tools in PEP 669. Potentially we can have more feedbacks for the monitoring mechanism. |
Sorry, something went wrong.
markshannon
left a comment
There was a problem hiding this comment.
I think we can skip creating builtin functions when profiling method descriptors.
Other than that, looks good.
Did you measure performance at all?
Sorry, something went wrong.
The performance measurement was in the original issue #103533, it might not be the most obvious format... |
Sorry, something went wrong.
|
I guess we don't have time now to make C level API changes if we want to land this in 3.12, but it would be nice to have |
Sorry, something went wrong.
markshannon
left a comment
There was a problem hiding this comment.
One last question
Sorry, something went wrong.
* main: pythongh-99113: Add PyInterpreterConfig.own_gil (pythongh-104204) pythongh-104146: Remove unused var 'parser_body_declarations' from clinic.py (python#104214) pythongh-99113: Add Py_MOD_PER_INTERPRETER_GIL_SUPPORTED (pythongh-104205) pythongh-104108: Add the Py_mod_multiple_interpreters Module Def Slot (pythongh-104148) pythongh-99113: Share the GIL via PyInterpreterState.ceval.gil (pythongh-104203) pythonGH-100479: Add `pathlib.PurePath.with_segments()` (pythonGH-103975) pythongh-69152: Add _proxy_response_headers attribute to HTTPConnection (python#26152) pythongh-103533: Use PEP 669 APIs for cprofile (pythonGH-103534) pythonGH-96803: Add three C-API functions to make _PyInterpreterFrame less opaque for users of PEP 523. (pythonGH-96849)
edited by bedevere-bot
LoadingUh oh!
There was an error while loading. Please reload this page.
Copy link Copy MarkdownSorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.