Python Runtime Method Call Binding

k3xji sumerc at gmail.com
Thu Dec 4 15:36:01 EST 2008


Thanks for the tips.

>3/ Now fact is that even all this won't probably be enough to implement
>a robust generic profiler - something which obviously requires a deep
>understanding of the language *and* it's implementation.

Indeed. Maybe not generic,but with these information at least I can
write my specific multi-threaded profiler. All I need to is to rebind
the methods/functions in the given modules and guard the callCount and
timeElapsed values via locks. And the difficult point here is the
timeElapsed information which should also take into account the thread
it is running on, I can specifically differentiate the threads by
looking at the args[0] parameter which is holding the self instance.
Of course for this to work, I need to limit which objects to
rebind..etc.etc.

Briefly,  I think  I got what I asked for:)

Thanks,



More information about the Python-list mailing list