-
-
Notifications
You must be signed in to change notification settings - Fork 30.9k
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
Drop CALL_PROFILE special build? #72985
Comments
Python/ceval.c contains conditional code to compute statistics on function calls when CALL_PROFILE is defined. Extract of Misc/SpecialBuilds.txt:
Statistics can later be collected by sys.callstats(). I'm unable to find any unit test on this feature. The feature was added in Python 2.3.1 by the changeset 16856c9514e0 in 2003: -DCALL_PROFILE: Count the number of function calls executed. When this symbol is defined, the ceval mainloop and helper functions Optimization: When we take the fast_function() path, which seems to be taken for The optimization gets a little help from compile.c which adds a I measure a couple of percent speedup in pystone with this change, but The changeset adds an optimization using CO_NOFREE and the CALL_PROFILE feature. My problem is that with my work on FASTCALL, it became harder to track where the functions are called in practice. It maybe out of the Python/ceval.c file. I'm not sure that statistics are still computed correctly after my FASTCALL changes, and I don't know how to check it. Python has already sys.setprofile(), cProfile and profile modules. There is also sys.settrace(). Do we still need CALL_PROFILE? Attached patch removes the feature:
PyEval_GetCallStats() seems to be part of the stable API, but I don't expect that anyone uses it outside the CPython source code since it requires to rebuild CPython with a special build flag (-D CALL_PROFILE). |
Jeremy Hylton, the author of the feature, approved the removal of CALL_PROFILE: Raymond Hettinger is also ok to remove it: |
New changeset 5aa2171ee43f by Victor Stinner in branch 'default': |
New changeset 07d8272d61e7 by Victor Stinner in branch 'default': |
I removed the function from Python 3.9 in bpo-37414. |
Misc/NEWS
so that it is managed by towncrier #552Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: