Author: tim.bunce
Date: Thu Jul  2 04:31:23 2009
New Revision: 790

Modified:
    trunk/NYTProf.xs
    trunk/bin/nytprofhtml
    trunk/lib/Devel/NYTProf.pm
    trunk/lib/Devel/NYTProf/js/jit/Treemap.css

Log:
Don't create treemap boxes if they're too small to be useful.
Other minor tweaks.


Modified: trunk/NYTProf.xs
==============================================================================
--- trunk/NYTProf.xs    (original)
+++ trunk/NYTProf.xs    Thu Jul  2 04:31:23 2009
@@ -347,11 +347,9 @@
      /* we avoid using any perl mechanisms here */
      va_list args;
      va_start(args, pat);
-
      if (!logfh)
          logfh = stderr;
      vfprintf(logfh, pat, args);
-
      va_end(args);
  }


Modified: trunk/bin/nytprofhtml
==============================================================================
--- trunk/bin/nytprofhtml       (original)
+++ trunk/bin/nytprofhtml       Thu Jul  2 04:31:23 2009
@@ -33,6 +33,8 @@
      die "$0 version '$VERSION' doesn't match  
version '$Devel::NYTProf::Core::VERSION' of  
$INC{'Devel/NYTProf/Core.pm'}\n";
  }

+my @treemap_colors = (0..10);
+
  # These control the limits for what the script will consider ok to severe  
times
  # specified in standard deviations from the mean time
  use constant SEVERITY_SEVERE => 2.0;    # above this deviation, a  
bottleneck
@@ -673,14 +675,14 @@
      my $default_new_args = {
          titleHeight => 0, # no titles
          addLeftClickHandler => 1,   # zoom in
-        addRightClickHandler => 1, # zoom out (XXX but disables right  
click menu)
+        #addRightClickHandler => 1, # zoom out (XXX but disables right  
click menu)
          offset => 0, # (0/2/4) extra padding around nested levels

          Color => {
              allow => 1,
              # value range for the $color property
              minValue => 0,
-            maxValue => 10,
+            maxValue => scalar @treemap_colors,
              # corresponding color range [R,G,B]:
              minColorValue => [0, 255, 50],
              maxColorValue => [255, 0, 50],
@@ -751,6 +753,20 @@
                  }
              });

+            TM.Squarified.implement({
+                createBox: function(json, coord, html) {
+                    if((coord.width * coord.height > 1) &&  
json.data.\$area > 0) {
+                        if(!this.leaf(json))
+                            var box = this.headBox(json, coord) +  
this.bodyBox(html, coord);
+                        else
+                            var box = this.leafBox(json, coord);
+                        return this.contentBox(json, coord, box);
+                    } else {
+                        return ""; //return empty string
+                    }
+                }
+            });
+
              var $name = new TM.Squarified(tm_args);

              var json = $tree_data_json;
@@ -776,7 +792,6 @@
          return $data;
      };

-    my @colors = (0..10);
      our $nid;
      my $node_mapper;
      $node_mapper = sub {
@@ -799,7 +814,7 @@

              # subs within this package
              our $color_seqn; # all subs in pkg get same color
-            my $color = $colors[ $color_seqn++ % @colors ];
+            my $color = $treemap_colors[ $color_seqn++ % @treemap_colors ];

              for my $info (@$infos) {


Modified: trunk/lib/Devel/NYTProf.pm
==============================================================================
--- trunk/lib/Devel/NYTProf.pm  (original)
+++ trunk/lib/Devel/NYTProf.pm  Thu Jul  2 04:31:23 2009
@@ -665,9 +665,6 @@

  Processor affinity can be set using the C<taskset> command on Linux.

-Future versions of NYTProf could support setting processor affinity  
automatically
-(e.g. via sched_setaffinity() on Linux). Patches welcome!
-
  Note that processor affinity is inherited by child processes, so if the  
process
  you're profiling spawns cpu intensive sub processes then your process will  
be
  impacted by those more than it otherwise would.

Modified: trunk/lib/Devel/NYTProf/js/jit/Treemap.css
==============================================================================
--- trunk/lib/Devel/NYTProf/js/jit/Treemap.css  (original)
+++ trunk/lib/Devel/NYTProf/js/jit/Treemap.css  Thu Jul  2 04:31:23 2009
@@ -19,19 +19,19 @@
  #infovis div {
      position:absolute;
      overflow:hidden;
-    background-color:transparent;
+    background-color: #666666;
  }

  #infovis1 div {
      position:absolute;
      overflow:hidden;
-    background-color:transparent;
+    background-color: #666666;
  }

  #infovis2 div {
      position:absolute;
      overflow:hidden;
-    background-color:transparent;
+    background-color: #666666;
  }

  /*

--~--~---------~--~----~------------~-------~--~----~
You've received this message because you are subscribed to
the Devel::NYTProf Development User group.

Group hosted at:  http://groups.google.com/group/develnytprof-dev
Project hosted at:  http://perl-devel-nytprof.googlecode.com
CPAN distribution:  http://search.cpan.org/dist/Devel-NYTProf

To post, email:  [email protected]
To unsubscribe, email:  [email protected]
-~----------~----~----~----~------~----~------~--~---

Reply via email to