the new profiler and profiling c calls

I think there's a slight problem with the profiling of C calls in the new profiler. When profiling method calls, the C function name is the repr() of the method, which means that a call for instance on str.endswith on different string instances ends up as completely separate calls. This might be intentional, but it's different than the way Python code is profiled, and it's irritating. Testing if a thousand different lines ends in a certain way means the default output from profile gets another thousand lines. I don't really think that's how it should be.

I think there's a slight problem with the profiling of C calls in the new profiler.
When profiling method calls, the C function name is the repr() of the method, which means that a call for instance on str.endswith on different string instances ends up as completely separate calls. This might be intentional, but it's different than the way Python code is profiled, and it's irritating.
Testing if a thousand different lines ends in a certain way means the default output from profile gets another thousand lines. I don't really think that's how it should be.
I saw a checkin that changed this to repr() and I didn't understand the point either, but I can easily be convinced that that was the wrong fix for whatever it was trying to fix. (Sorry, no time for more detail. CVS log is your friend. :-) --Guido van Rossum (home page: http://www.python.org/~guido/)

On Jul 12, 2004, at 9:08 PM, Guido van Rossum wrote:
I think there's a slight problem with the profiling of C calls in the new profiler.
When profiling method calls, the C function name is the repr() of the method, which means that a call for instance on str.endswith on different string instances ends up as completely separate calls. This might be intentional, but it's different than the way Python code is profiled, and it's irritating.
Testing if a thousand different lines ends in a certain way means the default output from profile gets another thousand lines. I don't really think that's how it should be.
I saw a checkin that changed this to repr() and I didn't understand the point either, but I can easily be convinced that that was the wrong fix for whatever it was trying to fix.
That was my bad. It's been fixed. -- Nick
participants (3)
-
Guido van Rossum
-
Nick Bastin
-
Simon Percivall