Revision: 1324
Author: [email protected]
Date: Thu Jul 8 02:11:40 2010
Log: Flag the file on the index page in which we first saw the slow match
variables.
http://code.google.com/p/perl-devel-nytprof/source/detail?r=1324
Modified:
/trunk/Changes
/trunk/bin/nytprofhtml
=======================================
--- /trunk/Changes Wed Jul 7 10:05:28 2010
+++ /trunk/Changes Thu Jul 8 02:11:40 2010
@@ -14,6 +14,8 @@
=head2 Changes in Devel::NYTProf 4.04
+TODO: time reporting for subs that recurse is wrong (eg fib() in
demo/demo-code.pl)
+
Profile records presence of the slow regex match vars ($& $' $`).
XXX not included in reports yet
=======================================
--- /trunk/bin/nytprofhtml Sat Jun 19 11:56:26 2010
+++ /trunk/bin/nytprofhtml Thu Jul 8 02:11:40 2010
@@ -1271,6 +1271,7 @@
my $allTimes = $profile->{attribute}{total_stmts_duration};
my $allCalls = $profile->{attribute}{total_stmts_measured}
- $profile->{attribute}{total_stmts_discounted};
+ my $sawampersand_fid = $profile->{attribute}{sawampersand_fid};
my (@t_stmt_exec, @t_stmt_time);
my @fis = $profile->noneval_fileinfos;
@@ -1280,16 +1281,17 @@
foreach my $fi (@fis) {
my $meta = $fi->meta;
+ my $fid = $fi->fid;
my @extra;
+ my $css_class = 'index';
# The stats in this table include rolled up sums of nested evals.
- my @has_evals = $fi->has_evals(1);
my ($eval_stmts, $eval_time) = (0,0);
- if (@has_evals) {
+ if (my @has_evals = $fi->has_evals(1)) {
my $n_evals = scalar @has_evals;
my $msg = sprintf "including %d string eval%s", $n_evals,
($n_evals>1) ? "s" : "";
- if (my @nested = grep { $_->eval_fid != $fi->fid } @has_evals)
{
+ if (my @nested = grep { $_->eval_fid != $fid } @has_evals) {
$msg .= sprintf ": %d direct plus %d nested",
$n_eva...@nested, scalar @nested;
}
@@ -1297,8 +1299,12 @@
$eval_stmts = sum(map { $_->sum_of_stmts_count } @has_evals);
$eval_time = sum(map { $_->sum_of_stmts_time } @has_evals);
}
-
- print $fh qq{<tr class="index">};
+ if ($fid == $sawampersand_fid) {
+ push @extra, "variables that impact regex performance for
whole application seen here";
+ $css_class = "warn $css_class";
+ }
+
+ print $fh qq{<tr class="$css_class">};
my $stmts = $meta->{'calls'} + $eval_stmts;
print $fh determine_severity($stmts, undef, 0,
--
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]