← 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/PNG.pm
StatementsExecuted 22 statements in 2.83ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
11189µs357µsRTP::Webmerge::Optimize::PNG::::BEGIN@11RTP::Webmerge::Optimize::PNG::BEGIN@11
11183µs83µsRTP::Webmerge::Optimize::PNG::::BEGIN@19RTP::Webmerge::Optimize::PNG::BEGIN@19
11156µs89µsRTP::Webmerge::Optimize::PNG::::BEGIN@13RTP::Webmerge::Optimize::PNG::BEGIN@13
11154µs762µsRTP::Webmerge::Optimize::PNG::::BEGIN@34RTP::Webmerge::Optimize::PNG::BEGIN@34
11152µs140µsRTP::Webmerge::Optimize::PNG::::BEGIN@12RTP::Webmerge::Optimize::PNG::BEGIN@12
11123µs23µsRTP::Webmerge::Optimize::PNG::::BEGIN@29RTP::Webmerge::Optimize::PNG::BEGIN@29
11122µs22µsRTP::Webmerge::Optimize::PNG::::__ANON__[:52]RTP::Webmerge::Optimize::PNG::__ANON__[:52]
11120µs20µsRTP::Webmerge::Optimize::PNG::::__ANON__[:80]RTP::Webmerge::Optimize::PNG::__ANON__[:80]
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::PNG;
9###################################################################################################
10
112161µs2625µs
# spent 357µs (89+268) within RTP::Webmerge::Optimize::PNG::BEGIN@11 which was called: # once (89µs+268µs) by main::BEGIN@49 at line 11
use Carp;
# spent 357µs making 1 call to RTP::Webmerge::Optimize::PNG::BEGIN@11 # spent 268µs making 1 call to Exporter::import
122160µs2228µs
# spent 140µs (52+88) within RTP::Webmerge::Optimize::PNG::BEGIN@12 which was called: # once (52µs+88µs) by main::BEGIN@49 at line 12
use strict;
# spent 140µs making 1 call to RTP::Webmerge::Optimize::PNG::BEGIN@12 # spent 88µs making 1 call to strict::import
132351µs2122µs
# spent 89µs (56+33) within RTP::Webmerge::Optimize::PNG::BEGIN@13 which was called: # once (56µs+33µs) by main::BEGIN@49 at line 13
use warnings;
# spent 89µs making 1 call to RTP::Webmerge::Optimize::PNG::BEGIN@13 # spent 33µs making 1 call to warnings::import
14
15###################################################################################################
16
17# setup some global settings
18BEGIN
19
# spent 83µs within RTP::Webmerge::Optimize::PNG::BEGIN@19 which was called: # once (83µs+0s) by main::BEGIN@49 at line 24
{
20 # enable (or disable) different optimizer executables
21122µs $ENV{'WEBMERGE_ADVDEF'} = 1 unless exists $ENV{'WEBMERGE_ADVDEF'};
22128µs $ENV{'WEBMERGE_ADVPNG'} = 1 unless exists $ENV{'WEBMERGE_ADVPNG'};
23139µs $ENV{'WEBMERGE_OPTIPNG'} = 1 unless exists $ENV{'WEBMERGE_OPTIPNG'};
241148µs183µs}
# spent 83µs making 1 call to RTP::Webmerge::Optimize::PNG::BEGIN@19
25
26###################################################################################################
27
28# define our version string
291151µs123µs
# spent 23µs within RTP::Webmerge::Optimize::PNG::BEGIN@29 which was called: # once (23µs+0s) by main::BEGIN@49 at line 29
BEGIN { $RTP::Webmerge::Optimize::PNG::VERSION = "0.70" }
# spent 23µs making 1 call to RTP::Webmerge::Optimize::PNG::BEGIN@29
30
31###################################################################################################
32
33# load webmberge module variables to hook into
3421.57ms21.47ms
# spent 762µs (54+708) within RTP::Webmerge::Optimize::PNG::BEGIN@34 which was called: # once (54µs+708µs) by main::BEGIN@49 at line 34
use RTP::Webmerge qw(@initers @checkers %executables range);
# spent 762µs making 1 call to RTP::Webmerge::Optimize::PNG::BEGIN@34 # spent 708µs making 1 call to Exporter::import
35
36###################################################################################################
37
38# push to initers
39# return for getOpts
40push @initers, sub
41
# spent 22µs within RTP::Webmerge::Optimize::PNG::__ANON__[/home/ocbnet/domain/ocbnet.ch/vhost/webmerge/htdocs/webmerge/scripts/modules/RTP/Webmerge/Optimize/PNG.pm:52] which was called: # once (22µs+0s) by RTP::Webmerge::initConfig at line 263 of webmerge/scripts/modules/RTP/Webmerge.pm
{
42
43 # get config
4413µs my ($config) = @_;
45
46 # create config variable to be available
4714µs $config->{'optimize-png'} = undef;
48
49 # connect each tmpl variable with the getOpt option
50127µs return ('optimize-png|png!', \ $config->{'cmd_optimize-png'});
51
52128µs};
53# EO push initer
54
55###################################################################################################
56
57# push to checkers
58push @checkers, sub
59
# spent 20µs within RTP::Webmerge::Optimize::PNG::__ANON__[/home/ocbnet/domain/ocbnet.ch/vhost/webmerge/htdocs/webmerge/scripts/modules/RTP/Webmerge/Optimize/PNG.pm:80] which was called: # once (20µs+0s) by RTP::Webmerge::checkConfig at line 290 of webmerge/scripts/modules/RTP/Webmerge.pm
{
60
61 # get config
6213µs my ($config) = @_;
63
64 # disable if not optimizing
6514µs unless ($config->{'optimize'})
66 { $config->{'optimize-png'} = 0; }
67
68 # do nothing if feature is disabled
69126µs return unless $config->{'optimize-png'};
70
71 # get the optimization level (1 to 4/6)
72 my $lvl = '-' . range($config->{'level'}, 1, 5, 4);
73 my $olvl = '-o' . range($config->{'level'}, 0.5, 6.5, 9);
74
75 # define executables to optimize pngs
76 $executables{'optipng'} = ['pngopt', "$olvl --quiet \"%s\"", 1] if $ENV{'WEBMERGE_OPTIPNG'};
77 $executables{'advpng'} = ['pngopt', "-z $lvl --quiet \"%s\"", 2] if $ENV{'WEBMERGE_ADVPNG'};
78 $executables{'advdef[png]'} = ['pngopt', "-z $lvl --quiet \"%s\"", 2] if $ENV{'WEBMERGE_ADVDEF'};
79
80122µs};
81# EO push checker
82
83###################################################################################################
84
85# now create a new file optimizer subroutine and hook it into our optimizers
86132µs162µs$RTP::Webmerge::Optimize::optimizer{'png'} = RTP::Webmerge::Optimize::optimize('png');
# spent 62µs making 1 call to RTP::Webmerge::Optimize::optimize
87
88###################################################################################################
89###################################################################################################
90150µs1;