[issue28799] Drop CALL_PROFILE special build?

2019-06-26 Thread STINNER Victor


STINNER Victor  added the comment:

I removed the function from Python 3.9 in bpo-37414.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28799] Drop CALL_PROFILE special build?

2017-03-31 Thread Donald Stufft

Changes by Donald Stufft :


--
pull_requests: +939

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28799] Drop CALL_PROFILE special build?

2016-11-28 Thread STINNER Victor

Changes by STINNER Victor :


--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28799] Drop CALL_PROFILE special build?

2016-11-28 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 07d8272d61e7 by Victor Stinner in branch 'default':
Issue #28799: Update Misc/SpecialBuilds.txt
https://hg.python.org/cpython/rev/07d8272d61e7

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28799] Drop CALL_PROFILE special build?

2016-11-28 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 5aa2171ee43f by Victor Stinner in branch 'default':
Remove CALL_PROFILE special build
https://hg.python.org/cpython/rev/5aa2171ee43f

--
nosy: +python-dev

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28799] Drop CALL_PROFILE special build?

2016-11-28 Thread STINNER Victor

STINNER Victor added the comment:

Jeremy Hylton, the author of the feature, approved the removal of CALL_PROFILE:
https://mail.python.org/pipermail/python-dev/2016-November/146866.html

Raymond Hettinger is also ok to remove it:
"This seems reasonable to me.  I've never used or needed this special build; 
StackOverflow has no mention of it; and a Google search comes up nearly empty.  
 That said, it might be worthwhile to check with Jeremy to get his thoughts 
before removing his code."
https://mail.python.org/pipermail/python-dev/2016-November/146864.html

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28799] Drop CALL_PROFILE special build?

2016-11-26 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
nosy: +Jeremy.Hylton

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28799] Drop CALL_PROFILE special build?

2016-11-25 Thread STINNER Victor

Changes by STINNER Victor :


--
keywords: +patch
Added file: http://bugs.python.org/file45637/remove_call_profile.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28799] Drop CALL_PROFILE special build?

2016-11-25 Thread STINNER Victor

New submission from STINNER Victor:

Python/ceval.c contains conditional code to compute statistics on function 
calls when CALL_PROFILE is defined.

Extract of Misc/SpecialBuilds.txt:

CALL_PROFILE


Count the number of function calls executed.

When this symbol is defined, the ceval mainloop and
helper functions count the number of function calls
made.  It keeps detailed statistics about what kind of
object was called and whether the call hit any of the
special fast paths in the code.

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:
---
changeset:   27712:16856c9514e0
branch:  legacy-trunk
user:Jeremy Hylton 
date:Wed Feb 05 23:13:00 2003 +
files:   Include/ceval.h Include/compile.h Misc/SpecialBuilds.txt 
Python/ceval.c Python/compile.c Python/sysmodule.c
description:
Small function call optimization and special build option for call stats.

-DCALL_PROFILE: Count the number of function calls executed.

When this symbol is defined, the ceval mainloop and helper functions
count the number of function calls made.  It keeps detailed statistics
about what kind of object was called and whether the call hit any of
the special fast paths in the code.

Optimization:

When we take the fast_function() path, which seems to be taken for
most function calls, and there is minimal frame setup to do, avoid
call PyEval_EvalCodeEx().  The eval code ex function does a lot of
work to handle keywords args and star args, free variables,
generators, etc.  The inlined version simply allocates the frame and
copies the arguments values into the frame.

The optimization gets a little help from compile.c which adds a
CO_NOFREE flag to code objects that don't have free variables or cell
variables.  This change allows fast_function() to get into the fast
path with fewer tests.

I measure a couple of percent speedup in pystone with this change, but
there's surely more that can be done.
---

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:

* Calling the the untested and undocumented sys.callstats() function now emits 
a DeprecationWarning warning
* Remove the PyEval_GetCallStats() function and its documentation

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).

--
messages: 281687
nosy: haypo
priority: normal
severity: normal
status: open
title: Drop CALL_PROFILE special build?
versions: Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com