re-import lsprof.py
Carl Friedrich Bolz
cfbolz at gmx.de
Mon Aug 14 11:36:54 BST 2006
John Arbash Meinel wrote:
> Carl Friedrich Bolz wrote:
>> The lsprof.py that is included in bzr lags quite a big behind between
>> the original file. Is it possible to re-import it? It crashes because of
>> things that I have in my site.py and this particular bug has been fixed
>> in the official version. The newest version can be found here:
>>
>> http://codespeak.net/svn/user/arigo/hack/misc/lsprof/
>>
>> I also chatted a bit with Armin Rigo (one of the maintainers of lsprof)
>> and it seems that lsprof.py is a deprecated interface and should be
>> replaced by the use of cProfile.py, which has the same interface as the
>> original python profiler. cProfile.py will also be included in
>> Python2.5, so we should consider using that in bzr. The setup.py in the
>> above package installs cProfile.py, so that shouldn't be a problem
>> either.
>>
>> Cheers,
>>
>> Carl Friedrich
>
> The biggest problem is that the cProfile.py interface sucks compared
> with the deprecated lsprof.py version. :)
Well, it tries to be a drop-in replaceent for the interace of
profile.py.
> The original python profiler could not generate the nicely nested call
> graphs that lsprof.py can generate. And for me, there are 2 reasons to
> use lsprof, it is more accurate, and it generates the nested call graph.
> The second being more important than the first (for me).
>
> Maybe I'm missing something about the cProfile.py version.
I think that cProfile.py can generate the nice nested call graphs too
(and definitively does that in 2.5). The problem is that for that to
work it needs a modified pstats.py which supports the storing of the
additional info. Alas, installing pstats.py in site-packages is not
enough, since site-packages is considered after builtin modules. This is
not a problem for debian-based linux distros: there pstats and profile
modules are by default not included in the python package due to
licensing reasons.
> I know the version in bzrlib is actually modified itself (by David
> Allouche, IIRC). It can output the same format that KCacheGrind uses,
> which should have benefits for some people (this is not hooked up as an
> output format for bzr, but should be).
>
> Do you know what differences fix your site.py issues? I think we are
> happy to update for any bugfixes.
Yes, I know that extension and it is quite cool. FWIW I attached the
patch that makes lsprof not crash for me (basically the same fix is in
Armin's latest version of lsprof.py).
Nevertheless, I think that in the long run (especially when Python 2.5
comes out) it would be much nicer to support cProfile, since Python 2.5
will ship that and people wouldn't have to install something separately.
Cheers,
Carl Friedrich
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lsprof.patch
Type: text/x-patch
Size: 412 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060814/65e62000/attachment.bin
More information about the bazaar
mailing list