← 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/Client/Engine.pm
StatementsExecuted 15 statements in 1.84ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
1112.34ms2.57msRazor2::Client::Engine::::BEGIN@6Razor2::Client::Engine::BEGIN@6
1111.51ms9.03msRazor2::Client::Engine::::BEGIN@8Razor2::Client::Engine::BEGIN@8
111676µs4.70msRazor2::Client::Engine::::BEGIN@7Razor2::Client::Engine::BEGIN@7
11147µs59µsRazor2::Client::Engine::::BEGIN@3Razor2::Client::Engine::BEGIN@3
11127µs122µsRazor2::Client::Engine::::BEGIN@4Razor2::Client::Engine::BEGIN@4
11125µs165µsRazor2::Client::Engine::::BEGIN@9Razor2::Client::Engine::BEGIN@9
11123µs108µsRazor2::Client::Engine::::BEGIN@5Razor2::Client::Engine::BEGIN@5
0000s0sRazor2::Client::Engine::::compute_engineRazor2::Client::Engine::compute_engine
0000s0sRazor2::Client::Engine::::newRazor2::Client::Engine::new
0000s0sRazor2::Client::Engine::::supported_enginesRazor2::Client::Engine::supported_engines
0000s0sRazor2::Client::Engine::::vr4_signatureRazor2::Client::Engine::vr4_signature
0000s0sRazor2::Client::Engine::::vr8_signatureRazor2::Client::Engine::vr8_signature
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package Razor2::Client::Engine;
2
3269µs271µs
# spent 59µs (47+12) within Razor2::Client::Engine::BEGIN@3 which was called: # once (47µs+12µs) by base::import at line 3
use strict;
# spent 59µs making 1 call to Razor2::Client::Engine::BEGIN@3 # spent 12µs making 1 call to strict::import
4260µs2218µs
# spent 122µs (27+96) within Razor2::Client::Engine::BEGIN@4 which was called: # once (27µs+96µs) by base::import at line 4
use Digest::SHA1 qw(sha1_hex);
# spent 122µs making 1 call to Razor2::Client::Engine::BEGIN@4 # spent 96µs making 1 call to Exporter::import
5265µs2192µs
# spent 108µs (23+84) within Razor2::Client::Engine::BEGIN@5 which was called: # once (23µs+84µs) by base::import at line 5
use Data::Dumper;
# spent 108µs making 1 call to Razor2::Client::Engine::BEGIN@5 # spent 84µs making 1 call to Exporter::import
62367µs12.57ms
# spent 2.57ms (2.34+224µs) within Razor2::Client::Engine::BEGIN@6 which was called: # once (2.34ms+224µs) by base::import at line 6
use Razor2::Signature::Ephemeral;
# spent 2.57ms making 1 call to Razor2::Client::Engine::BEGIN@6
72328µs14.70ms
# spent 4.70ms (676µs+4.02) within Razor2::Client::Engine::BEGIN@7 which was called: # once (676µs+4.02ms) by base::import at line 7
use Razor2::Engine::VR8;
# spent 4.70ms making 1 call to Razor2::Client::Engine::BEGIN@7
82344µs19.03ms
# spent 9.03ms (1.51+7.52) within Razor2::Client::Engine::BEGIN@8 which was called: # once (1.51ms+7.52ms) by base::import at line 8
use Razor2::Preproc::Manager;
# spent 9.03ms making 1 call to Razor2::Client::Engine::BEGIN@8
92602µs2305µs
# spent 165µs (25+140) within Razor2::Client::Engine::BEGIN@9 which was called: # once (25µs+140µs) by base::import at line 9
use Razor2::String qw(hextobase64 makesis debugobj);
# spent 165µs making 1 call to Razor2::Client::Engine::BEGIN@9 # spent 140µs making 1 call to Exporter::import
10
11# meant to be inherited
12#
13sub new {
14 return {};
15}
16
17
18sub supported_engines {
19
20 my @a = qw( 4 8 );
21
22 my $hr = {};
23 foreach (@a) { $hr->{$_} = 1; }
24
25 return wantarray ? @a : $hr;
26}
27
28
29sub compute_engine {
30 my ($self, $engine, @params) = @_;
31
32 return $self->vr4_signature(@params) if $engine == 4;
33 return $self->vr8_signature(@params) if $engine == 8;
34
35 $self->log (1,"engine $engine not supported");
36 return;
37}
38
39#
40# The following *_signature subroutines should be
41# the same as the ones on the server
42#
43
44
45#
46# VR4 Engine - Ephemereal signatures of decoded body content
47#
48sub vr4_signature {
49 my ($self, $text, $ep4) = @_;
50 my ($seed, $separator) = split /-/, $ep4, 2;
51
52 return $self->log(1,"vr4_signature: Bad ep4: $ep4") unless ($seed && $separator);
53
54 my $ehash = new Razor2::Signature::Ephemeral (seed => $seed, separator => $separator);
55 my $digest = $ehash->hexdigest($$text);
56
57 my $sig = hextobase64($digest);
58 $self->log (11,"engine 4 computing on ". length($$text) .", sig=$sig");
59 return $sig;
60}
61
62
63sub vr8_signature {
64 my ($self, $text) = @_;
65 my $vr8 = Razor2::Engine::VR8->new();
66
67 my $sigs = $vr8->signature($text);
68
69 return $sigs;
70}
71
7218µs1;