← Index
NYTProf Performance Profile   « line view »
For /usr/local/bin/sa-learn
  Run on Sun Nov 5 02:36:06 2017
Reported on Sun Nov 5 02:56:21 2017

Filename/usr/local/lib/perl5/site_perl/mach/5.24/Razor2/Preproc/Manager.pm
StatementsExecuted 17 statements in 6.98ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
1112.52ms2.52msRazor2::Preproc::Manager::::BEGIN@5Razor2::Preproc::Manager::BEGIN@5
111849µs849µsRazor2::Preproc::Manager::::BEGIN@2Razor2::Preproc::Manager::BEGIN@2
111790µs790µsRazor2::Preproc::Manager::::BEGIN@3Razor2::Preproc::Manager::BEGIN@3
111741µs741µsRazor2::Preproc::Manager::::BEGIN@7Razor2::Preproc::Manager::BEGIN@7
111589µs1.70msRazor2::Preproc::Manager::::BEGIN@4Razor2::Preproc::Manager::BEGIN@4
111539µs1.80msRazor2::Preproc::Manager::::BEGIN@6Razor2::Preproc::Manager::BEGIN@6
11144µs217µsRazor2::Preproc::Manager::::BEGIN@8Razor2::Preproc::Manager::BEGIN@8
11133µs41µsRazor2::Preproc::Manager::::BEGIN@9Razor2::Preproc::Manager::BEGIN@9
0000s0sRazor2::Preproc::Manager::::log2fileRazor2::Preproc::Manager::log2file
0000s0sRazor2::Preproc::Manager::::newRazor2::Preproc::Manager::new
0000s0sRazor2::Preproc::Manager::::preprocRazor2::Preproc::Manager::preproc
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package Razor2::Preproc::Manager;
22887µs1849µ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
use Razor2::Preproc::deBase64;
# spent 849µs making 1 call to Razor2::Preproc::Manager::BEGIN@2
32840µs1790µ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
use Razor2::Preproc::deQP;
# spent 790µs making 1 call to Razor2::Preproc::Manager::BEGIN@3
42362µs21.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
use Razor2::Preproc::deHTMLxs;
# spent 1.70ms making 1 call to Razor2::Preproc::Manager::BEGIN@4 # spent 110µs making 1 call to Exporter::import
522.58ms12.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
use Razor2::Preproc::deHTML;
# spent 2.52ms making 1 call to Razor2::Preproc::Manager::BEGIN@5
62344µs11.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
use Razor2::Preproc::deNewline;
# spent 1.80ms making 1 call to Razor2::Preproc::Manager::BEGIN@6
72803µs1741µ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
use Razor2::Preproc::deHTML_comment;
# spent 741µs making 1 call to Razor2::Preproc::Manager::BEGIN@7
8280µs2390µ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
use Data::Dumper;
# spent 217µs making 1 call to Razor2::Preproc::Manager::BEGIN@8 # spent 173µs making 1 call to Exporter::import
921.07ms249µ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
use strict;
# spent 41µs making 1 call to Razor2::Preproc::Manager::BEGIN@9 # spent 8µs making 1 call to strict::import
10
11sub 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#
32sub 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
84sub 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
9619µs1;
97
98