Patchwork [2,of,3,stable] profiling: improve '+' markup of nested lines

login
register
mail settings
Submitter Mads Kiilerich
Date Jan. 29, 2013, 5:04 p.m.
Message ID <8256fe23401ea99fb840.1359479092@mk-desktop>
Download mbox | patch
Permalink /patch/757/
State Superseded
Headers show

Comments

Mads Kiilerich - Jan. 29, 2013, 5:04 p.m.
# HG changeset patch
# User Mads Kiilerich <madski@unity3d.com>
# Date 1359478615 -3600
# Branch stable
# Node ID 8256fe23401ea99fb8408f3873005a905254ab30
# Parent  5af8588d1a8f449ab5d22e38ac745c3021428f3a
profiling: improve '+' markup of nested lines

The display of nested lines was very non-obvious and made it look like sort
didn't work.

The '+' immediately before CallCount was not related to the CallCount and did
not mean plus in any integer sense.

The '+' before module looked like a part of the module name and not like ascii art.

Instead we now only show '+' before the module name but add a space to make it
look more like ascii art.
Mads Kiilerich - Jan. 29, 2013, 7:09 p.m.
On 01/29/2013 07:19 PM, Kevin Bullock wrote:
> On Jan 29, 2013, at 11:04 AM, Mads Kiilerich wrote:
>
>> # HG changeset patch
>> # User Mads Kiilerich <madski@unity3d.com>
>> # Date 1359478615 -3600
>> # Branch stable
>> # Node ID 8256fe23401ea99fb8408f3873005a905254ab30
>> # Parent  5af8588d1a8f449ab5d22e38ac745c3021428f3a
>> profiling: improve '+' markup of nested lines
> Yeah, this and the next should probably be saved until after release.

Yeah - the first is in crew with some changes.

/Mads

Patch

diff --git a/mercurial/lsprof.py b/mercurial/lsprof.py
--- a/mercurial/lsprof.py
+++ b/mercurial/lsprof.py
@@ -50,9 +50,9 @@ 
             ccount = 0
             if climit and e.calls:
                 for se in e.calls:
-                    file.write(cols % ("+%s" % se.callcount, se.reccallcount,
+                    file.write(cols % (se.callcount, se.reccallcount,
                                        se.totaltime, se.inlinetime,
-                                       "+%s" % label(se.code)))
+                                       "+ %s" % label(se.code)))
                     count += 1
                     ccount += 1
                     if limit is not None and count == limit: