← Index
NYTProf Performance Profile   « line view »
For webmerge/scripts/webmerge.pl
  Run on Mon Oct 7 02:42:42 2013
Reported on Mon Oct 7 03:03:25 2013

Filename/home/ocbnet/domain/ocbnet.ch/vhost/webmerge/htdocs/webmerge/scripts/modules/RTP/Webmerge/Optimize/MNG.pm
StatementsExecuted 21 statements in 2.28ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
111111µs388µsRTP::Webmerge::Optimize::MNG::::BEGIN@11RTP::Webmerge::Optimize::MNG::BEGIN@11
11155µs791µsRTP::Webmerge::Optimize::MNG::::BEGIN@33RTP::Webmerge::Optimize::MNG::BEGIN@33
11153µs85µsRTP::Webmerge::Optimize::MNG::::BEGIN@13RTP::Webmerge::Optimize::MNG::BEGIN@13
11152µs141µsRTP::Webmerge::Optimize::MNG::::BEGIN@12RTP::Webmerge::Optimize::MNG::BEGIN@12
11149µs49µsRTP::Webmerge::Optimize::MNG::::BEGIN@19RTP::Webmerge::Optimize::MNG::BEGIN@19
11122µs22µsRTP::Webmerge::Optimize::MNG::::__ANON__[:51]RTP::Webmerge::Optimize::MNG::__ANON__[:51]
11122µs22µsRTP::Webmerge::Optimize::MNG::::BEGIN@28RTP::Webmerge::Optimize::MNG::BEGIN@28
11121µs21µsRTP::Webmerge::Optimize::MNG::::__ANON__[:77]RTP::Webmerge::Optimize::MNG::__ANON__[:77]
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1###################################################################################################
2# Copyright 2013 by Marcel Greter
3# This file is part of Webmerge (GPL3)
4###################################################################################################
5# http://optipng.sourceforge.net/pngtech/optipng.html
6# pngrewrite, pngcrush, OptiPNG, AdvanceCOMP (advpng), PNGOut
7###################################################################################################
8package RTP::Webmerge::Optimize::MNG;
9###################################################################################################
10
112173µs2665µs
# spent 388µs (111+277) within RTP::Webmerge::Optimize::MNG::BEGIN@11 which was called: # once (111µs+277µs) by main::BEGIN@50 at line 11
use Carp;
# spent 388µs making 1 call to RTP::Webmerge::Optimize::MNG::BEGIN@11 # spent 277µs making 1 call to Exporter::import
122144µs2230µs
# spent 141µs (52+89) within RTP::Webmerge::Optimize::MNG::BEGIN@12 which was called: # once (52µs+89µs) by main::BEGIN@50 at line 12
use strict;
# spent 141µs making 1 call to RTP::Webmerge::Optimize::MNG::BEGIN@12 # spent 89µs making 1 call to strict::import
132322µs2117µs
# spent 85µs (53+32) within RTP::Webmerge::Optimize::MNG::BEGIN@13 which was called: # once (53µs+32µs) by main::BEGIN@50 at line 13
use warnings;
# spent 85µs making 1 call to RTP::Webmerge::Optimize::MNG::BEGIN@13 # spent 32µs making 1 call to warnings::import
14
15###################################################################################################
16
17# setup some global settings
18BEGIN
19
# spent 49µs within RTP::Webmerge::Optimize::MNG::BEGIN@19 which was called: # once (49µs+0s) by main::BEGIN@50 at line 23
{
20 # enable (or disable) different optimizer executables
2114µs $ENV{'WEBMERGE_ADVDEF'} = 1 unless exists $ENV{'WEBMERGE_ADVDEF'};
22147µs $ENV{'WEBMERGE_ADVMNG'} = 1 unless exists $ENV{'WEBMERGE_ADVMNG'};
231174µs149µs}
# spent 49µs making 1 call to RTP::Webmerge::Optimize::MNG::BEGIN@19
24
25###################################################################################################
26
27# define our version string
281171µs122µs
# spent 22µs within RTP::Webmerge::Optimize::MNG::BEGIN@28 which was called: # once (22µs+0s) by main::BEGIN@50 at line 28
BEGIN { $RTP::Webmerge::Optimize::MNG::VERSION = "0.70" }
# spent 22µs making 1 call to RTP::Webmerge::Optimize::MNG::BEGIN@28
29
30###################################################################################################
31
32# load webmberge module variables to hook into
3321.11ms21.53ms
# spent 791µs (55+736) within RTP::Webmerge::Optimize::MNG::BEGIN@33 which was called: # once (55µs+736µs) by main::BEGIN@50 at line 33
use RTP::Webmerge qw(@initers @checkers %executables range);
# spent 791µs making 1 call to RTP::Webmerge::Optimize::MNG::BEGIN@33 # spent 736µs making 1 call to Exporter::import
34
35###################################################################################################
36
37# push to initers
38# return for getOpts
39push @initers, sub
40
# spent 22µs within RTP::Webmerge::Optimize::MNG::__ANON__[/home/ocbnet/domain/ocbnet.ch/vhost/webmerge/htdocs/webmerge/scripts/modules/RTP/Webmerge/Optimize/MNG.pm:51] which was called: # once (22µs+0s) by RTP::Webmerge::initConfig at line 263 of webmerge/scripts/modules/RTP/Webmerge.pm
{
41
42 # get config
4314µs my ($config) = @_;
44
45 # create config variable to be available
4614µs $config->{'optimize-mng'} = undef;
47
48 # connect each tmpl variable with the getOpt option
49128µs return ('optimize-mng|mng!', \ $config->{'cmd_optimize-mng'});
50
51116µs};
52# EO push initer
53
54###################################################################################################
55
56# push to checkers
57push @checkers, sub
58
# spent 21µs within RTP::Webmerge::Optimize::MNG::__ANON__[/home/ocbnet/domain/ocbnet.ch/vhost/webmerge/htdocs/webmerge/scripts/modules/RTP/Webmerge/Optimize/MNG.pm:77] which was called: # once (21µs+0s) by RTP::Webmerge::checkConfig at line 290 of webmerge/scripts/modules/RTP/Webmerge.pm
{
59
60 # get config
6113µs my ($config) = @_;
62
63 # disable if not optimizing
6415µs unless ($config->{'optimize'})
65 { $config->{'optimize-mng'} = 0; }
66
67 # do nothing if feature is disabled
68124µs return unless $config->{'optimize-mng'};
69
70 # get the optimization level (1 to 4)
71 my $lvl = '-' . range($config->{'level'}, 1, 5, 4);
72
73 # define executables to optimize mngs
74 $executables{'advmng'} = ['mngopt', "-z $lvl --quiet \"%s\"", 2] if $ENV{'WEBMERGE_ADVMNG'};
75 $executables{'advdef[mng]'} = ['mngopt', "-z $lvl --quiet \"%s\"", 2] if $ENV{'WEBMERGE_ADVDEF'};
76
77114µs};
78# EO push checker
79
80###################################################################################################
81
82# now create a new file optimizer subroutine and hook it into our optimizers
83120µs135µs$RTP::Webmerge::Optimize::optimizer{'mng'} = RTP::Webmerge::Optimize::optimize('mng');
# spent 35µs making 1 call to RTP::Webmerge::Optimize::optimize
84
85###################################################################################################
86###################################################################################################
87122µs1;