← Index
NYTProf Performance Profile   « line view »
For /usr/local/bin/sa-learn
  Run on Tue Nov 7 05:38:10 2017
Reported on Tue Nov 7 06:16:04 2017

Filename/usr/local/lib/perl5/site_perl/mach/5.24/Razor2/Preproc/Manager.pm
StatementsExecuted 17 statements in 6.72ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
1112.52ms2.52msRazor2::Preproc::Manager::::BEGIN@5Razor2::Preproc::Manager::BEGIN@5
111807µs807µsRazor2::Preproc::Manager::::BEGIN@2Razor2::Preproc::Manager::BEGIN@2
111757µs757µsRazor2::Preproc::Manager::::BEGIN@3Razor2::Preproc::Manager::BEGIN@3
111705µs705µsRazor2::Preproc::Manager::::BEGIN@7Razor2::Preproc::Manager::BEGIN@7
111546µs1.58msRazor2::Preproc::Manager::::BEGIN@4Razor2::Preproc::Manager::BEGIN@4
111531µs1.74msRazor2::Preproc::Manager::::BEGIN@6Razor2::Preproc::Manager::BEGIN@6
11133µs162µsRazor2::Preproc::Manager::::BEGIN@8Razor2::Preproc::Manager::BEGIN@8
11124µ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;
22843µs1807µs
# spent 807µs within Razor2::Preproc::Manager::BEGIN@2 which was called: # once (807µs+0s) by Razor2::Client::Engine::BEGIN@8 at line 2
use Razor2::Preproc::deBase64;
# spent 807µs making 1 call to Razor2::Preproc::Manager::BEGIN@2
32818µs1757µs
# spent 757µs within Razor2::Preproc::Manager::BEGIN@3 which was called: # once (757µs+0s) by Razor2::Client::Engine::BEGIN@8 at line 3
use Razor2::Preproc::deQP;
# spent 757µs making 1 call to Razor2::Preproc::Manager::BEGIN@3
42340µs21.66ms
# spent 1.58ms (546µs+1.03) within Razor2::Preproc::Manager::BEGIN@4 which was called: # once (546µs+1.03ms) by Razor2::Client::Engine::BEGIN@8 at line 4
use Razor2::Preproc::deHTMLxs;
# spent 1.58ms making 1 call to Razor2::Preproc::Manager::BEGIN@4 # spent 82µ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
62306µs11.74ms
# spent 1.74ms (531µs+1.21) within Razor2::Preproc::Manager::BEGIN@6 which was called: # once (531µs+1.21ms) by Razor2::Client::Engine::BEGIN@8 at line 6
use Razor2::Preproc::deNewline;
# spent 1.74ms making 1 call to Razor2::Preproc::Manager::BEGIN@6
72772µs1705µs
# spent 705µs within Razor2::Preproc::Manager::BEGIN@7 which was called: # once (705µs+0s) by Razor2::Client::Engine::BEGIN@8 at line 7
use Razor2::Preproc::deHTML_comment;
# spent 705µs making 1 call to Razor2::Preproc::Manager::BEGIN@7
8274µs2291µs
# spent 162µs (33+129) within Razor2::Preproc::Manager::BEGIN@8 which was called: # once (33µs+129µs) by Razor2::Client::Engine::BEGIN@8 at line 8
use Data::Dumper;
# spent 162µs making 1 call to Razor2::Preproc::Manager::BEGIN@8 # spent 129µs making 1 call to Exporter::import
92968µs258µs
# spent 41µs (24+17) within Razor2::Preproc::Manager::BEGIN@9 which was called: # once (24µs+17µ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 17µ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