← Index
NYTProf Performance Profile   « block view • line view • sub view »
For lexer.pl
  Run on Thu Mar 22 18:01:49 2012
Reported on Thu Mar 22 18:02:02 2012

Filename/Users/smash/playground/Parse-Lexer/lexer.pl
StatementsExecuted 37 statements in 13.0ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
11113.4ms31.8msmain::::BEGIN@2main::BEGIN@2
161137µs37µsmain::::CORE:prtfmain::CORE:prtf (opcode)
41112µs12µsmain::::CORE:qrmain::CORE:qr (opcode)
0000s0smain::::RUNTIMEmain::RUNTIME
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1
2312.8ms131.8ms
# spent 31.8ms (13.4+18.4) within main::BEGIN@2 which was called: # once (13.4ms+18.4ms) by main::RUNTIME at line 2
use Parse::Lexer;
# spent 31.8ms making 1 call to main::BEGIN@2
3
4127µs529µsmy $lexer = Parse::Lexer->new(
# spent 17µs making 1 call to Parse::Lexer::new # spent 12µs making 4 calls to main::CORE:qr, avg 3µs/call
5 PLUS => qr/\+/,
6 MINUS => qr/\-/,
7 NUMBER => qr/[0-9]+/,
8 IDENT => qr/[a-z]+/,
9 );
10
11154µs168.83mswhile (my ($token,$value) = $lexer->next) {
# spent 8.83ms making 16 calls to Parse::Lexer::next, avg 552µs/call
121678µs1637µs printf "[%s]", $value;
# spent 37µs making 16 calls to main::CORE:prtf, avg 2µs/call
13
141612µs last unless ($token and $value); # XXX
15}
16
 
# spent 37µs within main::CORE:prtf which was called 16 times, avg 2µs/call: # 16 times (37µs+0s) by main::RUNTIME at line 12, avg 2µs/call
sub main::CORE:prtf; # opcode
# spent 12µs within main::CORE:qr which was called 4 times, avg 3µs/call: # 4 times (12µs+0s) by main::RUNTIME at line 4, avg 3µs/call
sub main::CORE:qr; # opcode