Devel-StatProfiler
view release on metacpan or search on metacpan
t/301_report_slowops.t view on Meta::CPAN
my $profile_file;
BEGIN { $profile_file = temp_profile_file(); }
my $LONG_STR = " X" x 1000000;
use Devel::StatProfiler -file => $profile_file, -interval => 1000;
my ($l1);
for (my $count = precision_factor == 1 ? 10000 : 20000; ; $count *= 2) {
my $start = time;
note("Trying with $count iterations");
t::lib::Slowops::foo($count);
-d '.' && $LONG_STR =~ s/ $// for 1..$count; BEGIN { $l1 = __LINE__ + 0 }
last if time - $start >= 0.5;
}
Devel::StatProfiler::stop_profile();
my $slowops_foo_line = 9;
my $r = Devel::StatProfiler::Report->new(
slowops => [qw(ftdir subst)],
t/302_report_recursive.t view on Meta::CPAN
my $profile_file;
BEGIN { $profile_file = temp_profile_file(); }
use Devel::StatProfiler -file => $profile_file, -interval => 1000;
my ($l1, $l2, $l3, $l4);
my $count;
for ($count = 1000; ; $count *= 2) {
my $start = time;
note("Trying with $count iterations");
1 for 1..$count;
last if time - $start >= 0.3;
}
sub foo {
if ($_[0] == 0) {
1 for 1..$count; BEGIN { $l1 = __LINE__ + 0 }
return 1;
} else {
return foo($_[0] - 1) + 1; BEGIN { $l2 = __LINE__ + 0 }
t/310_report_merge.t view on Meta::CPAN
use Devel::StatProfiler::Report;
use Time::HiRes qw(time);
my $profile_file;
BEGIN { $profile_file = temp_profile_file(); }
use Devel::StatProfiler -file => $profile_file, -interval => 1000;
for (my $count = 10000; ; $count *= 2) {
my $start = time;
note("Trying with $count iterations");
t::lib::Slowops::foo($count);
-d '.' for 1..$count;
last if time - $start >= 0.5;
}
Devel::StatProfiler::stop_profile();
my ($process_id);
my $r1 = Devel::StatProfiler::Report->new(
t/350_aggregation.t view on Meta::CPAN
use Devel::StatProfiler::NameMap;
use Time::HiRes qw(time);
my ($profile_dir, $template);
BEGIN { ($profile_dir, $template) = temp_profile_dir(); }
use Devel::StatProfiler -template => $template, -interval => 1000;
for (my $count = 1000; ; $count *= 2) {
my $start = time;
note("Trying with $count iterations");
t::lib::Slowops::foo($count);
-d '.' for 1..$count;
last if time - $start >= 0.5;
}
Devel::StatProfiler::stop_profile();
my @files = glob "$template.*";
my $process_id;
t/352_can_process_trace_file.t view on Meta::CPAN
use Devel::StatProfiler::Aggregator;
use Time::HiRes qw(time);
my ($profile_dir, $template);
BEGIN { ($profile_dir, $template) = temp_profile_dir(); }
use Devel::StatProfiler -template => $template, -interval => 1000, -maxsize => 300;
for (my $count = 1000; ; $count *= 2) {
my $start = time;
note("Trying with $count iterations");
t::lib::Slowops::foo($count);
-d '.' for 1..$count;
last if time - $start >= 0.5;
}
Devel::StatProfiler::stop_profile();
my @files = glob "$template.*";
my $process_id;
t/365_timeboxing.t view on Meta::CPAN
use Devel::StatProfiler::Aggregator;
use Time::HiRes qw(time);
my ($profile_dir, $template);
BEGIN { ($profile_dir, $template) = temp_profile_dir(); }
use Devel::StatProfiler -template => $template, -interval => 1000;
for (my $count = 1000; ; $count *= 2) {
my $start = time;
note("Trying with $count iterations");
t::lib::Slowops::foo($count);
-d '.' for 1..$count;
last if time - $start >= 0.5;
}
Devel::StatProfiler::stop_profile();
my @files = glob "$template.*";
my ($process_id, $samples);
t/900_visual_report.t view on Meta::CPAN
use Devel::StatProfiler -file => $profile_file, -interval => 1000, -source => 'traced_evals';
use Test::Begin;
eval <<'EOT'; # extra __END__ token to check source code fetching
__END__
EOT
for (my $count = 10000; ; $count *= 2) {
my $start = time;
note("Trying with $count iterations");
t::lib::Slowops::foo($count);
-d '.' for 1..$count;
last if time - $start >= 0.5;
}
Devel::StatProfiler::write_inc_path;
Devel::StatProfiler::stop_profile();
my $r = Devel::StatProfiler::Report->new(
slowops => [qw(ftdir unstack)],
( run in 0.891 second using v1.01-cache-2.11-cpan-71847e10f99 )