Filename | /usr/local/lib/perl5/site_perl/mach/5.24/Razor2/Preproc/Manager.pm |
Statements | Executed 17 statements in 6.98ms |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
1 | 1 | 1 | 2.52ms | 2.52ms | BEGIN@5 | Razor2::Preproc::Manager::
1 | 1 | 1 | 849µs | 849µs | BEGIN@2 | Razor2::Preproc::Manager::
1 | 1 | 1 | 790µs | 790µs | BEGIN@3 | Razor2::Preproc::Manager::
1 | 1 | 1 | 741µs | 741µs | BEGIN@7 | Razor2::Preproc::Manager::
1 | 1 | 1 | 589µs | 1.70ms | BEGIN@4 | Razor2::Preproc::Manager::
1 | 1 | 1 | 539µs | 1.80ms | BEGIN@6 | Razor2::Preproc::Manager::
1 | 1 | 1 | 44µs | 217µs | BEGIN@8 | Razor2::Preproc::Manager::
1 | 1 | 1 | 33µs | 41µs | BEGIN@9 | Razor2::Preproc::Manager::
0 | 0 | 0 | 0s | 0s | log2file | Razor2::Preproc::Manager::
0 | 0 | 0 | 0s | 0s | new | Razor2::Preproc::Manager::
0 | 0 | 0 | 0s | 0s | preproc | Razor2::Preproc::Manager::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | package Razor2::Preproc::Manager; | ||||
2 | 2 | 887µs | 1 | 849µs | # spent 849µs within Razor2::Preproc::Manager::BEGIN@2 which was called:
# once (849µs+0s) by Razor2::Client::Engine::BEGIN@8 at line 2 # spent 849µs making 1 call to Razor2::Preproc::Manager::BEGIN@2 |
3 | 2 | 840µs | 1 | 790µs | # spent 790µs within Razor2::Preproc::Manager::BEGIN@3 which was called:
# once (790µs+0s) by Razor2::Client::Engine::BEGIN@8 at line 3 # spent 790µs making 1 call to Razor2::Preproc::Manager::BEGIN@3 |
4 | 2 | 362µs | 2 | 1.81ms | # spent 1.70ms (589µs+1.11) within Razor2::Preproc::Manager::BEGIN@4 which was called:
# once (589µs+1.11ms) by Razor2::Client::Engine::BEGIN@8 at line 4 # spent 1.70ms making 1 call to Razor2::Preproc::Manager::BEGIN@4
# spent 110µs making 1 call to Exporter::import |
5 | 2 | 2.58ms | 1 | 2.52ms | # spent 2.52ms within Razor2::Preproc::Manager::BEGIN@5 which was called:
# once (2.52ms+0s) by Razor2::Client::Engine::BEGIN@8 at line 5 # spent 2.52ms making 1 call to Razor2::Preproc::Manager::BEGIN@5 |
6 | 2 | 344µs | 1 | 1.80ms | # spent 1.80ms (539µs+1.26) within Razor2::Preproc::Manager::BEGIN@6 which was called:
# once (539µs+1.26ms) by Razor2::Client::Engine::BEGIN@8 at line 6 # spent 1.80ms making 1 call to Razor2::Preproc::Manager::BEGIN@6 |
7 | 2 | 803µs | 1 | 741µs | # spent 741µs within Razor2::Preproc::Manager::BEGIN@7 which was called:
# once (741µs+0s) by Razor2::Client::Engine::BEGIN@8 at line 7 # spent 741µs making 1 call to Razor2::Preproc::Manager::BEGIN@7 |
8 | 2 | 80µs | 2 | 390µs | # spent 217µs (44+173) within Razor2::Preproc::Manager::BEGIN@8 which was called:
# once (44µs+173µs) by Razor2::Client::Engine::BEGIN@8 at line 8 # spent 217µs making 1 call to Razor2::Preproc::Manager::BEGIN@8
# spent 173µs making 1 call to Exporter::import |
9 | 2 | 1.07ms | 2 | 49µs | # spent 41µs (33+8) within Razor2::Preproc::Manager::BEGIN@9 which was called:
# once (33µs+8µs) by Razor2::Client::Engine::BEGIN@8 at line 9 # spent 41µs making 1 call to Razor2::Preproc::Manager::BEGIN@9
# spent 8µs making 1 call to strict::import |
10 | |||||
11 | sub new { | ||||
12 | |||||
13 | my ($class, %args) = @_; | ||||
14 | |||||
15 | my %self = (); | ||||
16 | |||||
17 | $self{deBase64} = new Razor2::Preproc::deBase64 unless exists $args{no_deBase64}; | ||||
18 | $self{deQP} = new Razor2::Preproc::deQP unless exists $args{no_deQP}; | ||||
19 | $self{deHTML} = new Razor2::Preproc::deHTMLxs unless exists $args{no_deHTML}; | ||||
20 | $self{deNewline} = new Razor2::Preproc::deNewline unless exists $args{no_deNewline}; | ||||
21 | $self{deHTML_comment} = new Razor2::Preproc::deHTML_comment if exists $args{deHTML_comment}; | ||||
22 | $self{rm} = $args{RM}; | ||||
23 | |||||
24 | return bless \%self, $class; | ||||
25 | |||||
26 | } | ||||
27 | |||||
28 | # | ||||
29 | # $bodyref must be Headers\n\r*\nBody | ||||
30 | # for this to work. Cleaned ref to Body returned. | ||||
31 | # | ||||
32 | sub preproc { | ||||
33 | |||||
34 | my ($self, $bodyref, $dolength) = @_; | ||||
35 | my $lengths = { '1_orig' => length($$bodyref) } if $dolength; | ||||
36 | |||||
37 | #-- $self->{rm}->{log}->log(12, "before_deBase64:"); | ||||
38 | if (exists $$self{deBase64} && $self->{deBase64}->isit($bodyref)) { | ||||
39 | $self->{deBase64}->doit($bodyref); | ||||
40 | } | ||||
41 | #-- $self->{rm}->{log}->log(12, "after_deBase64:"); | ||||
42 | |||||
43 | #$self->log2file($bodyref, "preproc.afta.debase64"); | ||||
44 | $lengths->{'2_after_deBase64'} = length($$bodyref) if $dolength; | ||||
45 | |||||
46 | #-- $self->{rm}->{log}->log(12, "before_deQP:"); | ||||
47 | my $isQP; | ||||
48 | if (exists $$self{deQP} && ($isQP = $self->{deQP}->isit($bodyref))) { | ||||
49 | $self->{deQP}->doit($bodyref); | ||||
50 | } | ||||
51 | #-- $self->{rm}->{log}->log(12, "after_deQP:"); | ||||
52 | |||||
53 | #$self->log2file($bodyref, "preproc.afta.deQP.$isQP"); | ||||
54 | $lengths->{'3_after_deQP'} = length($$bodyref) if $dolength; | ||||
55 | |||||
56 | #-- $self->{rm}->{log}->log(12, "before_deHTML:"); | ||||
57 | if (exists $$self{deHTML} && $self->{deHTML}->isit($bodyref)) { | ||||
58 | $self->{deHTML}->doit($bodyref); | ||||
59 | } | ||||
60 | #-- $self->{rm}->{log}->log(12, "after_deHTML:"); | ||||
61 | |||||
62 | if (exists $$self{deHTML_comment} && $self->{deHTML_comment}->isit($bodyref)) { | ||||
63 | $self->{deHTML_comment}->doit($bodyref); | ||||
64 | } | ||||
65 | |||||
66 | #-- $self->{rm}->{log}->log(12, "before_deNewline:"); | ||||
67 | if (exists $$self{deNewline}) { | ||||
68 | $self->{deNewline}->doit($bodyref); | ||||
69 | } | ||||
70 | #-- $self->{rm}->{log}->log(12, "after_deNewline:"); | ||||
71 | #$self->log2file($bodyref, "preproc.afta.deHTML"); | ||||
72 | $lengths->{'4_after_deHTML'} = length($$bodyref) if $dolength; | ||||
73 | |||||
74 | my ($hdr, $body) = split /\n\r*\n/, $$bodyref, 2; | ||||
75 | |||||
76 | $$bodyref = $body; | ||||
77 | $lengths->{'5_after_header_removal'} = length($$bodyref) if $dolength; | ||||
78 | |||||
79 | return $lengths; | ||||
80 | |||||
81 | } | ||||
82 | |||||
83 | |||||
84 | sub log2file { | ||||
85 | my ($self, $msgref, $mailid) = @_; | ||||
86 | my $len = length($$msgref); | ||||
87 | my $fn = "/tmp/.razor.debug.msg.$$.$mailid"; | ||||
88 | if (open OUT, ">$fn") { | ||||
89 | print OUT $$msgref; | ||||
90 | close OUT; | ||||
91 | } else { | ||||
92 | } | ||||
93 | } | ||||
94 | |||||
95 | |||||
96 | 1 | 9µs | 1; | ||
97 | |||||
98 |