Strange Hotshot problem...

KefX keflimarcusx at aol.comNOSPAM
Fri Oct 24 21:16:47 EDT 2003


Well, I found a rather unhelpful non-solution (just posting about it so nobody
else suggests it). I figured that the Work() function (being called the most
often given the architecture of the plugin, and the only one called from the
C++ code while outputting sound) would probably have the biggest bottleneck, so
I renamed my Work function to Work_Impl, and added a new Work function with
this:

def Work(num_samples):
    if _profiler is not None:
        return _profiler.runcall(Work_Impl, num_samples)
    else:
        return Work_Impl(num_samples)

This technically worked (my code finally produced a readable log in the proper
place). However, it was a failure in that this seemed to circumvent Psyco
completely (making my code WAY too slow), and the results weren't too helpful
in any case. An obvious solution is to make sure to call psyco.bind(Work_Impl),
and while this did speed it up I get no information on the functions that
Work_Impl called. Is there any other way to profile code that uses Psyco?
(Other than the older 'profile' module, which is probably even less likely to
work well...)




More information about the Python-list mailing list