| Filename | /home/ocbnet/domain/ocbnet.ch/vhost/webmerge/htdocs/webmerge/scripts/modules/RTP/Webmerge/Merge/CSS.pm |
| Statements | Executed 62 statements in 8.98ms |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 1 | 1 | 1 | 1.97ms | 3.39ms | RTP::Webmerge::Merge::CSS::BEGIN@58 |
| 8 | 1 | 1 | 1.92ms | 1.92ms | RTP::Webmerge::Merge::CSS::__ANON__[:65] |
| 8 | 1 | 1 | 1.85ms | 1.85ms | RTP::Webmerge::Merge::CSS::__ANON__[:63] |
| 8 | 1 | 1 | 618µs | 31.3s | RTP::Webmerge::Merge::CSS::__ANON__[:80] |
| 1 | 1 | 1 | 113µs | 405µs | RTP::Webmerge::Merge::CSS::BEGIN@50 |
| 1 | 1 | 1 | 86µs | 344µs | RTP::Webmerge::Merge::CSS::BEGIN@8 |
| 2 | 1 | 1 | 63µs | 287µs | RTP::Webmerge::Merge::CSS::__ANON__[:62] |
| 1 | 1 | 1 | 61µs | 754µs | RTP::Webmerge::Merge::CSS::BEGIN@41 |
| 1 | 1 | 1 | 57µs | 90µs | RTP::Webmerge::Merge::CSS::BEGIN@10 |
| 1 | 1 | 1 | 56µs | 622µs | RTP::Webmerge::Merge::CSS::BEGIN@42 |
| 1 | 1 | 1 | 54µs | 155µs | RTP::Webmerge::Merge::CSS::BEGIN@9 |
| 1 | 1 | 1 | 54µs | 54µs | RTP::Webmerge::Merge::CSS::BEGIN@18.19 |
| 1 | 1 | 1 | 24µs | 24µs | RTP::Webmerge::Merge::CSS::BEGIN@18 |
| 1 | 1 | 1 | 23µs | 23µs | RTP::Webmerge::Merge::CSS::BEGIN@24 |
| 1 | 1 | 1 | 22µs | 22µs | RTP::Webmerge::Merge::CSS::BEGIN@15 |
| 1 | 1 | 1 | 22µs | 22µs | RTP::Webmerge::Merge::CSS::BEGIN@21 |
| 0 | 0 | 0 | 0s | 0s | RTP::Webmerge::Merge::CSS::__ANON__[:64] |
| 0 | 0 | 0 | 0s | 0s | RTP::Webmerge::Merge::CSS::__ANON__[:66] |
| 0 | 0 | 0 | 0s | 0s | RTP::Webmerge::Merge::CSS::__ANON__[:75] |
| 0 | 0 | 0 | 0s | 0s | RTP::Webmerge::Merge::CSS::getLicense |
| 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::Merge::CSS; | ||||
| 6 | ################################################################################################### | ||||
| 7 | |||||
| 8 | 2 | 160µs | 2 | 602µs | # spent 344µs (86+258) within RTP::Webmerge::Merge::CSS::BEGIN@8 which was called:
# once (86µs+258µs) by RTP::Webmerge::Merge::BEGIN@69 at line 8 # spent 344µs making 1 call to RTP::Webmerge::Merge::CSS::BEGIN@8
# spent 258µs making 1 call to Exporter::import |
| 9 | 2 | 158µs | 2 | 255µs | # spent 155µs (54+100) within RTP::Webmerge::Merge::CSS::BEGIN@9 which was called:
# once (54µs+100µs) by RTP::Webmerge::Merge::BEGIN@69 at line 9 # spent 155µs making 1 call to RTP::Webmerge::Merge::CSS::BEGIN@9
# spent 100µs making 1 call to strict::import |
| 10 | 2 | 200µs | 2 | 123µs | # spent 90µs (57+33) within RTP::Webmerge::Merge::CSS::BEGIN@10 which was called:
# once (57µs+33µs) by RTP::Webmerge::Merge::BEGIN@69 at line 10 # spent 90µs making 1 call to RTP::Webmerge::Merge::CSS::BEGIN@10
# spent 33µs making 1 call to warnings::import |
| 11 | |||||
| 12 | ################################################################################################### | ||||
| 13 | |||||
| 14 | # define our version string | ||||
| 15 | 1 | 176µs | 1 | 22µs | # spent 22µs within RTP::Webmerge::Merge::CSS::BEGIN@15 which was called:
# once (22µs+0s) by RTP::Webmerge::Merge::BEGIN@69 at line 15 # spent 22µs making 1 call to RTP::Webmerge::Merge::CSS::BEGIN@15 |
| 16 | |||||
| 17 | # load exporter and inherit from it | ||||
| 18 | 3 | 363µs | 2 | 78µs | BEGIN { use Exporter qw(); our @ISA = qw(Exporter) } # spent 54µs making 1 call to RTP::Webmerge::Merge::CSS::BEGIN@18.19
# spent 24µs making 1 call to RTP::Webmerge::Merge::CSS::BEGIN@18 |
| 19 | |||||
| 20 | # define our functions to be exported | ||||
| 21 | 1 | 167µs | 1 | 22µs | # spent 22µs within RTP::Webmerge::Merge::CSS::BEGIN@21 which was called:
# once (22µs+0s) by RTP::Webmerge::Merge::BEGIN@69 at line 21 # spent 22µs making 1 call to RTP::Webmerge::Merge::CSS::BEGIN@21 |
| 22 | |||||
| 23 | # define our functions to be exported | ||||
| 24 | 1 | 527µs | 1 | 23µs | # spent 23µs within RTP::Webmerge::Merge::CSS::BEGIN@24 which was called:
# once (23µs+0s) by RTP::Webmerge::Merge::BEGIN@69 at line 24 # spent 23µs making 1 call to RTP::Webmerge::Merge::CSS::BEGIN@24 |
| 25 | |||||
| 26 | ################################################################################################### | ||||
| 27 | |||||
| 28 | # parse license from code | ||||
| 29 | sub getLicense | ||||
| 30 | { | ||||
| 31 | # map out the licenses from inputs | ||||
| 32 | return | ||||
| 33 | # remove everything but the very first comment (first line!) | ||||
| 34 | ${$_->{'data'}} =~m /\A\s*(\/\*(?:\n|\r|.)+?\*\/)\s*(?:\n|\r|.)*\z/m | ||||
| 35 | # return header with given input path and license or nothing | ||||
| 36 | ? ( '/* license for ' . $_->{'web_path'} . ' */', $1, '' ) : (); | ||||
| 37 | } | ||||
| 38 | |||||
| 39 | ################################################################################################### | ||||
| 40 | |||||
| 41 | 2 | 199µs | 2 | 1.45ms | # spent 754µs (61+693) within RTP::Webmerge::Merge::CSS::BEGIN@41 which was called:
# once (61µs+693µs) by RTP::Webmerge::Merge::BEGIN@69 at line 41 # spent 754µs making 1 call to RTP::Webmerge::Merge::CSS::BEGIN@41
# spent 693µs making 1 call to Exporter::import |
| 42 | 2 | 279µs | 2 | 1.19ms | # spent 622µs (56+567) within RTP::Webmerge::Merge::CSS::BEGIN@42 which was called:
# once (56µs+567µs) by RTP::Webmerge::Merge::BEGIN@69 at line 42 # spent 622µs making 1 call to RTP::Webmerge::Merge::CSS::BEGIN@42
# spent 567µs making 1 call to Exporter::import |
| 43 | |||||
| 44 | ################################################################################################### | ||||
| 45 | |||||
| 46 | # define joiner string | ||||
| 47 | 1 | 7µs | $joiner{'css'} = "\n"; | ||
| 48 | |||||
| 49 | # load IO functions | ||||
| 50 | 2 | 401µs | 2 | 697µs | # spent 405µs (113+292) within RTP::Webmerge::Merge::CSS::BEGIN@50 which was called:
# once (113µs+292µs) by RTP::Webmerge::Merge::BEGIN@69 at line 50 # spent 405µs making 1 call to RTP::Webmerge::Merge::CSS::BEGIN@50
# spent 292µs making 1 call to Exporter::import |
| 51 | |||||
| 52 | # assign IO functions | ||||
| 53 | 1 | 6µs | $reader{'css'} = \&readCSS; | ||
| 54 | 1 | 3µs | $importer{'css'} = \&importCSS; | ||
| 55 | 1 | 2µs | $exporter{'css'} = \&exportCSS; | ||
| 56 | 1 | 2µs | $writer{'css'} = \&writeCSS; | ||
| 57 | |||||
| 58 | 2 | 1.66ms | 2 | 3.90ms | # spent 3.39ms (1.97+1.42) within RTP::Webmerge::Merge::CSS::BEGIN@58 which was called:
# once (1.97ms+1.42ms) by RTP::Webmerge::Merge::BEGIN@69 at line 58 # spent 3.39ms making 1 call to RTP::Webmerge::Merge::CSS::BEGIN@58
# spent 512µs making 1 call to Exporter::import |
| 59 | |||||
| 60 | $includer{'css'} = | ||||
| 61 | { | ||||
| 62 | 2 | 60µs | 2 | 224µs | # spent 287µs (63+224) within RTP::Webmerge::Merge::CSS::__ANON__[/home/ocbnet/domain/ocbnet.ch/vhost/webmerge/htdocs/webmerge/scripts/modules/RTP/Webmerge/Merge/CSS.pm:62] which was called 2 times, avg 143µs/call:
# 2 times (63µs+224µs) by RTP::Webmerge::Merge::__ANON__[/home/ocbnet/domain/ocbnet.ch/vhost/webmerge/htdocs/webmerge/scripts/modules/RTP/Webmerge/Merge.pm:480] at line 444 of webmerge/scripts/modules/RTP/Webmerge/Merge.pm, avg 143µs/call # spent 224µs making 2 calls to RTP::Webmerge::Include::CSS::includeCSS, avg 112µs/call |
| 63 | 8 | 2.05ms | # spent 1.85ms within RTP::Webmerge::Merge::CSS::__ANON__[/home/ocbnet/domain/ocbnet.ch/vhost/webmerge/htdocs/webmerge/scripts/modules/RTP/Webmerge/Merge/CSS.pm:63] which was called 8 times, avg 231µs/call:
# 8 times (1.85ms+0s) by RTP::Webmerge::Merge::__ANON__[/home/ocbnet/domain/ocbnet.ch/vhost/webmerge/htdocs/webmerge/scripts/modules/RTP/Webmerge/Merge.pm:480] at line 444 of webmerge/scripts/modules/RTP/Webmerge/Merge.pm, avg 231µs/call | ||
| 64 | 'minify' => sub { ${$_->{'data'}} }, | ||||
| 65 | 8 | 2.14ms | # spent 1.92ms within RTP::Webmerge::Merge::CSS::__ANON__[/home/ocbnet/domain/ocbnet.ch/vhost/webmerge/htdocs/webmerge/scripts/modules/RTP/Webmerge/Merge/CSS.pm:65] which was called 8 times, avg 240µs/call:
# 8 times (1.92ms+0s) by RTP::Webmerge::Merge::__ANON__[/home/ocbnet/domain/ocbnet.ch/vhost/webmerge/htdocs/webmerge/scripts/modules/RTP/Webmerge/Merge.pm:480] at line 444 of webmerge/scripts/modules/RTP/Webmerge/Merge.pm, avg 240µs/call | ||
| 66 | 'license' => sub { getLicense($_) } | ||||
| 67 | 1 | 36µs | }; | ||
| 68 | |||||
| 69 | $processor{'css'} = | ||||
| 70 | { | ||||
| 71 | 'minify' => sub | ||||
| 72 | { | ||||
| 73 | require CSS::Minifier; | ||||
| 74 | &CSS::Minifier::minify('input' => $_[0]); | ||||
| 75 | }, | ||||
| 76 | 'compile' => sub | ||||
| 77 | # spent 31.3s (618µs+31.3) within RTP::Webmerge::Merge::CSS::__ANON__[/home/ocbnet/domain/ocbnet.ch/vhost/webmerge/htdocs/webmerge/scripts/modules/RTP/Webmerge/Merge/CSS.pm:80] which was called 8 times, avg 3.91s/call:
# 8 times (618µs+31.3s) by RTP::Webmerge::Merge::__ANON__[/home/ocbnet/domain/ocbnet.ch/vhost/webmerge/htdocs/webmerge/scripts/modules/RTP/Webmerge/Merge.pm:480] at line 459 of webmerge/scripts/modules/RTP/Webmerge/Merge.pm, avg 3.91s/call | ||||
| 78 | 8 | 36µs | require RTP::Webmerge::Compile::CSS; | ||
| 79 | 8 | 287µs | 8 | 31.3s | &RTP::Webmerge::Compile::CSS::compileCSS; # spent 31.3s making 8 calls to RTP::Webmerge::Compile::CSS::compileCSS, avg 3.91s/call |
| 80 | } | ||||
| 81 | 1 | 16µs | }; | ||
| 82 | |||||
| 83 | ################################################################################################### | ||||
| 84 | ################################################################################################### | ||||
| 85 | 1 | 40µs | 1; |