← Index
NYTProf Performance Profile   « line view »
For /usr/local/bin/sa-learn
  Run on Sun Nov 5 03:09:29 2017
Reported on Mon Nov 6 13:20:48 2017

Filename/usr/local/lib/perl5/site_perl/mach/5.24/Razor2/Preproc/Manager.pm
StatementsExecuted 17 statements in 6.13ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
1112.32ms2.32msRazor2::Preproc::Manager::::BEGIN@5Razor2::Preproc::Manager::BEGIN@5
111760µs760µsRazor2::Preproc::Manager::::BEGIN@2Razor2::Preproc::Manager::BEGIN@2
111713µs713µsRazor2::Preproc::Manager::::BEGIN@3Razor2::Preproc::Manager::BEGIN@3
111630µs630µsRazor2::Preproc::Manager::::BEGIN@7Razor2::Preproc::Manager::BEGIN@7
111486µs1.51msRazor2::Preproc::Manager::::BEGIN@6Razor2::Preproc::Manager::BEGIN@6
111477µs1.45msRazor2::Preproc::Manager::::BEGIN@4Razor2::Preproc::Manager::BEGIN@4
11124µs119µsRazor2::Preproc::Manager::::BEGIN@8Razor2::Preproc::Manager::BEGIN@8
11120µs28µ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;
22788µs1760µs
# spent 760µs within Razor2::Preproc::Manager::BEGIN@2 which was called: # once (760µs+0s) by Razor2::Client::Engine::BEGIN@8 at line 2
use Razor2::Preproc::deBase64;
# spent 760µs making 1 call to Razor2::Preproc::Manager::BEGIN@2
32756µs1713µs
# spent 713µs within Razor2::Preproc::Manager::BEGIN@3 which was called: # once (713µs+0s) by Razor2::Client::Engine::BEGIN@8 at line 3
use Razor2::Preproc::deQP;
# spent 713µs making 1 call to Razor2::Preproc::Manager::BEGIN@3
42294µs21.52ms
# spent 1.45ms (477µs+973µs) within Razor2::Preproc::Manager::BEGIN@4 which was called: # once (477µs+973µs) by Razor2::Client::Engine::BEGIN@8 at line 4
use Razor2::Preproc::deHTMLxs;
# spent 1.45ms making 1 call to Razor2::Preproc::Manager::BEGIN@4 # spent 66µs making 1 call to Exporter::import
522.37ms12.32ms
# spent 2.32ms within Razor2::Preproc::Manager::BEGIN@5 which was called: # once (2.32ms+0s) by Razor2::Client::Engine::BEGIN@8 at line 5
use Razor2::Preproc::deHTML;
# spent 2.32ms making 1 call to Razor2::Preproc::Manager::BEGIN@5
62276µs11.51ms
# spent 1.51ms (486µs+1.02) within Razor2::Preproc::Manager::BEGIN@6 which was called: # once (486µs+1.02ms) by Razor2::Client::Engine::BEGIN@8 at line 6
use Razor2::Preproc::deNewline;
# spent 1.51ms making 1 call to Razor2::Preproc::Manager::BEGIN@6
72677µs1630µs
# spent 630µs within Razor2::Preproc::Manager::BEGIN@7 which was called: # once (630µs+0s) by Razor2::Client::Engine::BEGIN@8 at line 7
use Razor2::Preproc::deHTML_comment;
# spent 630µs making 1 call to Razor2::Preproc::Manager::BEGIN@7
8257µs2214µs
# spent 119µs (24+95) within Razor2::Preproc::Manager::BEGIN@8 which was called: # once (24µs+95µs) by Razor2::Client::Engine::BEGIN@8 at line 8
use Data::Dumper;
# spent 119µs making 1 call to Razor2::Preproc::Manager::BEGIN@8 # spent 95µs making 1 call to Exporter::import
92905µs236µs
# spent 28µs (20+8) within Razor2::Preproc::Manager::BEGIN@9 which was called: # once (20µs+8µs) by Razor2::Client::Engine::BEGIN@8 at line 9
use strict;
# spent 28µ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
9618µs1;
97
98