in reply to where does the time go?
That's a little hard to reproduce. But if you can change this code to show the same behaviour then we may be able to help a little more.
use warnings; use strict; use Devel::Timer; search (); sub search { my $class = shift; my $t = Devel::Timer->new; $t->mark('a'); validate_search_index (); $t->mark('b'); my $target = 'some text to search some text to search some text to + search some text to search '; $target =~ /y/ for (0..10000); $t->mark('c'); $target =~ /y/ for (0..10000); $t->mark('d'); $target =~ /y/ for (0..10000); $t->report; } sub validate_search_index { my $t = Devel::Timer->new; $t->mark(0); my $target = 'some text to search some text to search some text to + search some text to search '; $target =~ /y/ for (0..10000); $t->mark(1); $target =~ /y/ for (0..10000); $t->mark(2); $target =~ /y/ for (0..10000); $t->mark(3); $target =~ /y/ for (0..10000); $t->mark(4); $target =~ /y/ for (0..10000); $t->report; }
Reports:
Devel::Timer Report -- Total time: 0.0153 secs Interval Time Percent ---------------------------------------------- 03 -> 04 0.0045 29.47% 2 -> 3 04 -> 05 0.0036 23.84% 3 -> 4 01 -> 02 0.0036 23.59% 0 -> 1 02 -> 03 0.0035 22.95% 1 -> 2 00 -> 01 0.0000 0.14% INIT -> 0 Devel::Timer Report -- Total time: 0.0268 secs Interval Time Percent ---------------------------------------------- 01 -> 02 0.0195 72.63% a -> b 02 -> 03 0.0037 13.87% b -> c 03 -> 04 0.0036 13.37% c -> d 00 -> 01 0.0000 0.14% INIT -> a
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: where does the time go?
by badaiaqrandista (Pilgrim) on Nov 01, 2005 at 00:50 UTC | |
by GrandFather (Saint) on Nov 01, 2005 at 00:54 UTC |