Skip to content

Commit

Permalink
OAK-641: Improved benchmark tooling
Browse files Browse the repository at this point in the history
Use unicode box drawing characters in analyze-hprof.pl

git-svn-id: https://svn.apache.org/repos/asf/jackrabbit/oak/trunk@1524805 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
jukka committed Sep 19, 2013
1 parent 33d82f0 commit 6901f9b
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions analyze-hprof.pl
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.

binmode STDOUT, ":utf8";

my %traces = ();
my $root = { 'count' => 0, 'frame' => 'root', 'children' => {} };
my $leaf = { 'count' => 0, 'frame' => 'leaf', 'children' => {} };
Expand Down Expand Up @@ -56,12 +58,12 @@ sub output {

my $last = $children[-1];
for my $child (@children) {
printf "%s+%d%% (%d%%) %s\n",
printf "%s%s%d%% %s\n",
$prefix,
($child == $last) ? "\x{2514}" : "\x{251c}",
$child->{'count'} * 100 / $total,
$child->{'count'} * 100 / $info->{'count'},
$child->{'frame'};
output($total, $child, ($child == $last) ? "$prefix " : "$prefix|");
output($total, $child, ($child == $last) ? "$prefix " : "$prefix\x{2502}");
}
}

Expand All @@ -73,7 +75,7 @@ sub output {
/^\s*\d+\s+\S+%\s+\S+%\s+(\d+)\s+(\d+)/ and accumulate($2, $1);
}

print "ROOT\n====\n";
print "Caller tree\n===========\n";
output($root->{'count'}, $root, "");
print "LEAF\n====\n";
print "Callee tree\n===========\n";
output($leaf->{'count'}, $leaf, "");

0 comments on commit 6901f9b

Please sign in to comment.