Filename | /home/ocbnet/domain/ocbnet.ch/vhost/webmerge/htdocs/webmerge/scripts/modules/RTP/Webmerge/Optimize/GIF.pm |
Statements | Executed 20 statements in 2.49ms |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
1 | 1 | 1 | 89µs | 372µs | BEGIN@8 | RTP::Webmerge::Optimize::GIF::
1 | 1 | 1 | 55µs | 85µs | BEGIN@10 | RTP::Webmerge::Optimize::GIF::
1 | 1 | 1 | 53µs | 736µs | BEGIN@29 | RTP::Webmerge::Optimize::GIF::
1 | 1 | 1 | 52µs | 140µs | BEGIN@9 | RTP::Webmerge::Optimize::GIF::
1 | 1 | 1 | 42µs | 42µs | BEGIN@16 | RTP::Webmerge::Optimize::GIF::
1 | 1 | 1 | 25µs | 25µs | __ANON__[:47] | RTP::Webmerge::Optimize::GIF::
1 | 1 | 1 | 22µs | 22µs | __ANON__[:72] | RTP::Webmerge::Optimize::GIF::
1 | 1 | 1 | 22µs | 22µs | BEGIN@24 | RTP::Webmerge::Optimize::GIF::
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 | package RTP::Webmerge::Optimize::GIF; | ||||
6 | ################################################################################################### | ||||
7 | |||||
8 | 2 | 180µs | 2 | 655µs | # spent 372µs (89+283) within RTP::Webmerge::Optimize::GIF::BEGIN@8 which was called:
# once (89µs+283µs) by main::BEGIN@47 at line 8 # spent 372µs making 1 call to RTP::Webmerge::Optimize::GIF::BEGIN@8
# spent 283µs making 1 call to Exporter::import |
9 | 2 | 146µs | 2 | 229µs | # spent 140µs (52+89) within RTP::Webmerge::Optimize::GIF::BEGIN@9 which was called:
# once (52µs+89µs) by main::BEGIN@47 at line 9 # spent 140µs making 1 call to RTP::Webmerge::Optimize::GIF::BEGIN@9
# spent 89µs making 1 call to strict::import |
10 | 2 | 241µs | 2 | 116µs | # spent 85µs (55+31) within RTP::Webmerge::Optimize::GIF::BEGIN@10 which was called:
# once (55µs+31µs) by main::BEGIN@47 at line 10 # spent 85µs making 1 call to RTP::Webmerge::Optimize::GIF::BEGIN@10
# spent 31µs making 1 call to warnings::import |
11 | |||||
12 | ################################################################################################### | ||||
13 | |||||
14 | # setup some global settings | ||||
15 | BEGIN | ||||
16 | # spent 42µs within RTP::Webmerge::Optimize::GIF::BEGIN@16 which was called:
# once (42µs+0s) by main::BEGIN@47 at line 19 | ||||
17 | # enable (or disable) different optimizer executables | ||||
18 | 1 | 47µs | $ENV{'WEBMERGE_GIFSICLE'} = 1 unless exists $ENV{'WEBMERGE_GIFSICLE'}; | ||
19 | 1 | 142µs | 1 | 42µs | } # spent 42µs making 1 call to RTP::Webmerge::Optimize::GIF::BEGIN@16 |
20 | |||||
21 | ################################################################################################### | ||||
22 | |||||
23 | # define our version string | ||||
24 | 1 | 161µs | 1 | 22µs | # spent 22µs within RTP::Webmerge::Optimize::GIF::BEGIN@24 which was called:
# once (22µs+0s) by main::BEGIN@47 at line 24 # spent 22µs making 1 call to RTP::Webmerge::Optimize::GIF::BEGIN@24 |
25 | |||||
26 | ################################################################################################### | ||||
27 | |||||
28 | # load webmberge module variables to hook into | ||||
29 | 2 | 1.42ms | 2 | 1.42ms | # spent 736µs (53+682) within RTP::Webmerge::Optimize::GIF::BEGIN@29 which was called:
# once (53µs+682µs) by main::BEGIN@47 at line 29 # spent 736µs making 1 call to RTP::Webmerge::Optimize::GIF::BEGIN@29
# spent 682µs making 1 call to Exporter::import |
30 | |||||
31 | ################################################################################################### | ||||
32 | |||||
33 | # push to initers | ||||
34 | # return for getOpts | ||||
35 | push @initers, sub | ||||
36 | # spent 25µs within RTP::Webmerge::Optimize::GIF::__ANON__[/home/ocbnet/domain/ocbnet.ch/vhost/webmerge/htdocs/webmerge/scripts/modules/RTP/Webmerge/Optimize/GIF.pm:47] which was called:
# once (25µs+0s) by RTP::Webmerge::initConfig at line 263 of webmerge/scripts/modules/RTP/Webmerge.pm | ||||
37 | |||||
38 | # get config | ||||
39 | 1 | 4µs | my ($config) = @_; | ||
40 | |||||
41 | # create config variable to be available | ||||
42 | 1 | 3µs | $config->{'optimize-gif'} = undef; | ||
43 | |||||
44 | # connect each tmpl variable with the getOpt option | ||||
45 | 1 | 30µs | return ('optimize-gif|gif!', \ $config->{'cmd_optimize-gif'}); | ||
46 | |||||
47 | 1 | 20µs | }; | ||
48 | # EO push initer | ||||
49 | |||||
50 | ################################################################################################### | ||||
51 | |||||
52 | # push to checkers | ||||
53 | push @checkers, sub | ||||
54 | # spent 22µs within RTP::Webmerge::Optimize::GIF::__ANON__[/home/ocbnet/domain/ocbnet.ch/vhost/webmerge/htdocs/webmerge/scripts/modules/RTP/Webmerge/Optimize/GIF.pm:72] which was called:
# once (22µs+0s) by RTP::Webmerge::checkConfig at line 290 of webmerge/scripts/modules/RTP/Webmerge.pm | ||||
55 | |||||
56 | # get config | ||||
57 | 1 | 5µs | my ($config) = @_; | ||
58 | |||||
59 | # disable if not optimizing | ||||
60 | 1 | 5µs | unless ($config->{'optimize'}) | ||
61 | { $config->{'optimize-gif'} = 0; } | ||||
62 | |||||
63 | # do nothing if feature is disabled | ||||
64 | 1 | 27µs | return unless $config->{'optimize-gif'}; | ||
65 | |||||
66 | # get the optimization level (1 to 3) | ||||
67 | my $lvl = '-O' . range($config->{'level'}, 1, 4, 3); | ||||
68 | |||||
69 | # define executables to optimize gifs | ||||
70 | $executables{'gifsicle'} = ['gifopt', "$lvl -o \"%s\" \"%s\""] if $ENV{'WEBMERGE_GIFSICLE'}; | ||||
71 | |||||
72 | 1 | 14µs | }; | ||
73 | # EO push checker | ||||
74 | |||||
75 | ################################################################################################### | ||||
76 | |||||
77 | # now create a new file optimizer subroutine and hook it into our optimizers | ||||
78 | 1 | 22µs | 1 | 38µs | $RTP::Webmerge::Optimize::optimizer{'gif'} = RTP::Webmerge::Optimize::optimize('gif'); # spent 38µs making 1 call to RTP::Webmerge::Optimize::optimize |
79 | |||||
80 | ################################################################################################### | ||||
81 | ################################################################################################### | ||||
82 | 1 | 23µs | 1; |