← 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:20 2013

Filename/home/ocbnet/domain/ocbnet.ch/vhost/webmerge/htdocs/webmerge/scripts/modules/RTP/Webmerge.pm
StatementsExecuted 413 statements in 18.1ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
1115.63ms11.7msRTP::Webmerge::::BEGIN@58RTP::Webmerge::BEGIN@58
1114.43ms98.6msRTP::Webmerge::::BEGIN@15RTP::Webmerge::BEGIN@15
74513.82ms347sRTP::Webmerge::::callProcessorRTP::Webmerge::callProcessor
1113.46ms87.9msRTP::Webmerge::::BEGIN@18RTP::Webmerge::BEGIN@18
111970µs1.44msRTP::Webmerge::::initConfigRTP::Webmerge::initConfig
111933µs2.79msRTP::Webmerge::::collectOutputsRTP::Webmerge::collectOutputs
111298µs3.40msRTP::Webmerge::::checkConfigRTP::Webmerge::checkConfig
111112µs116µsRTP::Webmerge::::collectExecutablesRTP::Webmerge::collectExecutables
11186µs376µsRTP::Webmerge::::BEGIN@8RTP::Webmerge::BEGIN@8
11173µs151µsRTP::Webmerge::::BEGIN@201RTP::Webmerge::BEGIN@201
11172µs211µsRTP::Webmerge::::BEGIN@21RTP::Webmerge::BEGIN@21
11157µs57µsRTP::Webmerge::::BEGIN@34.10RTP::Webmerge::BEGIN@34.10
11155µs87µsRTP::Webmerge::::BEGIN@10RTP::Webmerge::BEGIN@10
11152µs141µsRTP::Webmerge::::BEGIN@9RTP::Webmerge::BEGIN@9
11132µs32µsRTP::Webmerge::::BEGIN@40RTP::Webmerge::BEGIN@40
11131µs31µsRTP::Webmerge::::BEGIN@37RTP::Webmerge::BEGIN@37
11126µs26µsRTP::Webmerge::::checkProgramsRTP::Webmerge::checkPrograms
11125µs25µsRTP::Webmerge::::BEGIN@31RTP::Webmerge::BEGIN@31
11125µs25µsRTP::Webmerge::::BEGIN@34RTP::Webmerge::BEGIN@34
11114µs14µsRTP::Webmerge::::ENDRTP::Webmerge::END
1114µs4µsRTP::Webmerge::::CORE:sortRTP::Webmerge::CORE:sort (opcode)
0000s0sRTP::Webmerge::::__ANON__[:470]RTP::Webmerge::__ANON__[:470]
0000s0sRTP::Webmerge::::callProgramRTP::Webmerge::callProgram
0000s0sRTP::Webmerge::::checkProcessesRTP::Webmerge::checkProcesses
0000s0sRTP::Webmerge::::rangeRTP::Webmerge::range
0000s0sRTP::Webmerge::::runProgramRTP::Webmerge::runProgram
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###################################################################################################
5package RTP::Webmerge;
6###################################################################################################
7
82169µs2666µs
# spent 376µs (86+290) within RTP::Webmerge::BEGIN@8 which was called: # once (86µs+290µs) by main::BEGIN@28 at line 8
use Carp;
# spent 376µs making 1 call to RTP::Webmerge::BEGIN@8 # spent 290µs making 1 call to Exporter::import
92142µs2231µs
# spent 141µs (52+90) within RTP::Webmerge::BEGIN@9 which was called: # once (52µs+90µs) by main::BEGIN@28 at line 9
use strict;
# spent 141µs making 1 call to RTP::Webmerge::BEGIN@9 # spent 90µs making 1 call to strict::import
102169µs2119µs
# spent 87µs (55+32) within RTP::Webmerge::BEGIN@10 which was called: # once (55µs+32µs) by main::BEGIN@28 at line 10
use warnings;
# spent 87µs making 1 call to RTP::Webmerge::BEGIN@10 # spent 32µs making 1 call to warnings::import
11
12###################################################################################################
13
14# load 3rd party module
152708µs298.8ms
# spent 98.6ms (4.43+94.1) within RTP::Webmerge::BEGIN@15 which was called: # once (4.43ms+94.1ms) by main::BEGIN@28 at line 15
use File::Which qw(which);
# spent 98.6ms making 1 call to RTP::Webmerge::BEGIN@15 # spent 240µs making 1 call to Exporter::import
16
17# override core glob (case insensitive)
182755µs288.5ms
# spent 87.9ms (3.46+84.4) within RTP::Webmerge::BEGIN@18 which was called: # once (3.46ms+84.4ms) by main::BEGIN@28 at line 18
use File::Glob qw(:globally :nocase bsd_glob);
# spent 87.9ms making 1 call to RTP::Webmerge::BEGIN@18 # spent 672µs making 1 call to File::Glob::import
19
20# load function from core module
212352µs2350µs
# spent 211µs (72+139) within RTP::Webmerge::BEGIN@21 which was called: # once (72µs+139µs) by main::BEGIN@28 at line 21
use List::MoreUtils qw(uniq);
# spent 211µs making 1 call to RTP::Webmerge::BEGIN@21 # spent 139µs making 1 call to Exporter::import
22
23###################################################################################################
24
25# declare local globals
2614µsour (%programs, %executables, %processors, @initers, @checkers);
27
28###################################################################################################
29
30# define our version string
311149µs125µs
# spent 25µs within RTP::Webmerge::BEGIN@31 which was called: # once (25µs+0s) by main::BEGIN@28 at line 31
BEGIN { $RTP::Webmerge::VERSION = "0.70" }
# spent 25µs making 1 call to RTP::Webmerge::BEGIN@31
32
33# load exporter and inherit from it
343371µs282µs
# spent 57µs within RTP::Webmerge::BEGIN@34.10 which was called: # once (57µs+0s) by main::BEGIN@28 at line 34 # spent 25µs within RTP::Webmerge::BEGIN@34 which was called: # once (25µs+0s) by main::BEGIN@28 at line 34
BEGIN { use Exporter qw(); our @ISA = qw(Exporter) }
# spent 57µs making 1 call to RTP::Webmerge::BEGIN@34.10 # spent 25µs making 1 call to RTP::Webmerge::BEGIN@34
35
36# define our functions to be exported
371195µs131µs
# spent 31µs within RTP::Webmerge::BEGIN@37 which was called: # once (31µs+0s) by main::BEGIN@28 at line 37
BEGIN { our @EXPORT = qw(initConfig checkConfig callProgram runProgram callProcessor); }
# spent 31µs making 1 call to RTP::Webmerge::BEGIN@37
38
39# define our functions that can be exported
401458µs132µs
# spent 32µs within RTP::Webmerge::BEGIN@40 which was called: # once (32µs+0s) by main::BEGIN@28 at line 40
BEGIN { our @EXPORT_OK = qw(%programs %executables %processors @initers @checkers range); }
# spent 32µs making 1 call to RTP::Webmerge::BEGIN@40
41
42###################################################################################################
43
44sub range
45{
46
47 my ($value, $from, $to, $max) = @_;
48
49 my $val = int(($_[2] - $_[1]) / 9 * $_[0] + $_[1] + 0.5);
50
51 return $val < $max ? $val : $max;
52
53}
54
55###################################################################################################
56
57# make absolute paths (file may not exist yet)
5823.15ms212.1ms
# spent 11.7ms (5.63+6.11) within RTP::Webmerge::BEGIN@58 which was called: # once (5.63ms+6.11ms) by main::BEGIN@28 at line 58
use RTP::Webmerge::Path qw(res_path);
# spent 11.7ms making 1 call to RTP::Webmerge::BEGIN@58 # spent 382µs making 1 call to Exporter::import
59
60# collect all includes
61# return result hash
62sub collectOutputs
63
# spent 2.79ms (933µs+1.86) within RTP::Webmerge::collectOutputs which was called: # once (933µs+1.86ms) by RTP::Webmerge::checkConfig at line 306
{
64
65 # get input variables
6613µs my ($config) = @_;
67
68 # assertion that we only run once
6913µs return if (exists $config->{'outpaths'});
70
71 # get local variables from config
7213µs my $paths = $config->{'paths'};
7315µs my $doctype = $config->{'doctype'};
74
75 # get local arrays from loaded xml file
7616µs my $merges = $config->{'xml'}->{'merge'} || [];
7716µs my $headers = $config->{'xml'}->{'header'} || [];
78
79 # local variable
8014µs $config->{'outpaths'} = {};
81
82 # reset webpath after this block (make local)
8316µs local $config->{'webpath'} = $config->{'webpath'};
84
8515µs foreach my $block (@{$merges || []})
86 {
87
88 # change directory (restore previous state after this block)
89138µs121µs my $dir = RTP::Webmerge::Path->chdir($block->{'chdir'});
# spent 21µs making 1 call to RTP::Webmerge::Path::chdir
90
91 # process all types
9219µs foreach my $type ('css', 'js')
93 {
94
95 # process all include entries
96240µs foreach my $merge (map { @{$_->{$type} || []} } @{$merges || {} })
97 {
98
99 # change directory (restore previous state after this block)
100243µs2447µs my $dir = RTP::Webmerge::Path->chdir($merge->{'chdir'});
# spent 447µs making 2 calls to RTP::Webmerge::Path::chdir, avg 224µs/call
101
102 # get id of this merge
10329µs my $id = $merge->{'id'};
104
105 # create and assign info hash for this merge
106227µs my $info = $config->{'outpaths'}->{$id} = { 'out' => {} };
107
108 # store some important attributes
109210µs $info->{'id'} = $merge->{'id'};
11028µs $info->{'type'} = $type;
11126µs $info->{'media'} = $merge->{'media'};
112210µs $info->{'disabled'} = $merge->{'disabled'} || 'false';
113
114 # process all files to be written for this merge
115258µs227µs foreach my $output (@{$merge->{'output'} || []})
# spent 27µs making 2 calls to RTP::Webmerge::Path::DESTROY, avg 14µs/call
116 {
117
118 # get the class name for this output
1191857µs my $class = $output->{'class'} || 'default';
120
121 # assert that the target has been given for this output
1221829µs die 'no target given for output' unless $output->{'target'};
123
124 # create another sub hash for this class if needed
1251842µs $info->{'out'}->{$class} = {} unless exists $info->{'out'}->{$class};
126
127 # store the filepath for this merge output (by class/target)
128 # do not yet check for existence of the path as it may be created later
12918352µs181.36ms $info->{'out'}->{$class}->{$output->{'target'}} = res_path($output->{'path'});
# spent 1.36ms making 18 calls to RTP::Webmerge::Path::res_path, avg 76µs/call
130
131 }
132 # EO each output
133
134 }
135 # EO each merge
136
137 }
138 # EO each type (css/js)
139
140 }
141
142 # return success
143135µs return 1;
144
145}
146# EO sub collectOutputs
147
148###################################################################################################
149
150# collect available executables
151# add them to the programs hash
152sub collectExecutables
153
# spent 116µs (112+4) within RTP::Webmerge::collectExecutables which was called: # once (112µs+4µs) by RTP::Webmerge::checkConfig at line 296
{
154
15513µs my ($config) = @_;
156
157 # do checks every executable
158113µs foreach my $executable (keys %executables)
159 {
160
161 # get the bin path and the exec template
16217µs my ($program, $tmpl, $prio) = @{$executables{$executable}};
163
164 # create an array if not yet available
165110µs $programs{$program} = [] unless exists $programs{$program};
166
167 # skip if we have inline function
168118µs if (ref($tmpl) eq 'CODE')
169 {
170 # finally store the info and found absolute path
171 push(@{$programs{$program}}, [$tmpl]);
172 }
173 # look for external program
174 else
175 {
176
177 # get name of executable
178 my $exec = $executable;
179
180 # remove optional suffix
181 $exec =~ s/\[[a-zA-Z]+\]$//;
182
183 # glob finds the executable
184 my @files = which($exec) || bsd_glob($exec);
185
186 if (scalar(@files) == 1 && -e $files[0] && -x $files[0] && ! -d $files[0])
187 {
188 # finally store the info and found absolute path
189 push(@{$programs{$program}}, [$tmpl, $files[0], $prio]);
190 }
191
192 }
193
194 }
195 # EO each executable
196
197 # process all collected programs
198127µs foreach my $program (keys %programs)
199 {
200
20125.64ms2229µs
# spent 151µs (73+78) within RTP::Webmerge::BEGIN@201 which was called: # once (73µs+78µs) by main::BEGIN@28 at line 201
no warnings 'uninitialized';
# spent 151µs making 1 call to RTP::Webmerge::BEGIN@201 # spent 78µs making 1 call to warnings::unimport
202
203 # sort the programs by priority so they can run in given order
204150µs14µs @{$programs{$program}} = sort { $a->[2] - $b->[2] } @{$programs{$program}};
# spent 4µs making 1 call to RTP::Webmerge::CORE:sort
205
206 }
207 # EO each program
208
209}
210# EO sub collectExecutables
211
212###################################################################################################
213
214# check each program to have
215# at least one executable
216sub checkPrograms
217
# spent 26µs within RTP::Webmerge::checkPrograms which was called: # once (26µs+0s) by RTP::Webmerge::checkConfig at line 300
{
218
21913µs my ($config) = @_;
220
221 # do checks every executable
222127µs foreach my $program (keys %programs)
223 {
22418µs if (scalar(@{$programs{$program}}) == 0)
225 {
226 # we should tell te user which programs
227 # he could install to solve to problem
228 # for gifopt this would be gifsicle
229 die "program $program has no executables";
230 }
231 }
232 # EO each program
233
234}
235# EO sub checkPrograms
236
237###################################################################################################
238
239sub checkProcesses
240{
241
242 # to be implemented
243
244}
245# EO sub checkProcesses
246
247###################################################################################################
248
249sub initConfig
250
# spent 1.44ms (970µs+470µs) within RTP::Webmerge::initConfig which was called: # once (970µs+470µs) by main::RUNTIME at line 154 of webmerge/scripts/webmerge.pl
{
251
252 # get input variables
25314µs my ($config) = @_;
254
255 # declare lexical variable
25611µs my %getopts;
257
258 # process all registered initers
25917µs foreach my $initer (@initers)
260 {
261
262 # extend getopts by result from initer
26312742µs12470µs %getopts = (%getopts, $initer->($config));
# spent 75µs making 1 call to RTP::Webmerge::Embedder::__ANON__[webmerge/scripts/modules/RTP/Webmerge/Embedder.pm:75] # spent 71µs making 1 call to RTP::Webmerge::Process::CSS::Inlinedata::__ANON__[webmerge/scripts/modules/RTP/Webmerge/Process/CSS/Inlinedata.pm:338] # spent 66µs making 1 call to RTP::Webmerge::Fingerprint::__ANON__[webmerge/scripts/modules/RTP/Webmerge/Fingerprint.pm:52] # spent 52µs making 1 call to RTP::Webmerge::Optimize::GZ::__ANON__[webmerge/scripts/modules/RTP/Webmerge/Optimize/GZ.pm:47] # spent 37µs making 1 call to RTP::Webmerge::Optimize::TXT::__ANON__[webmerge/scripts/modules/RTP/Webmerge/Optimize/TXT.pm:108] # spent 28µs making 1 call to RTP::Webmerge::IO::CSS::__ANON__[webmerge/scripts/modules/RTP/Webmerge/IO/CSS.pm:202] # spent 25µs making 1 call to RTP::Webmerge::Optimize::ZIP::__ANON__[webmerge/scripts/modules/RTP/Webmerge/Optimize/ZIP.pm:47] # spent 25µs making 1 call to RTP::Webmerge::Optimize::GIF::__ANON__[webmerge/scripts/modules/RTP/Webmerge/Optimize/GIF.pm:47] # spent 24µs making 1 call to RTP::Webmerge::Optimize::JPG::__ANON__[webmerge/scripts/modules/RTP/Webmerge/Optimize/JPG.pm:48] # spent 23µs making 1 call to RTP::Webmerge::HeadInc::__ANON__[webmerge/scripts/modules/RTP/Webmerge/HeadInc.pm:49] # spent 22µs making 1 call to RTP::Webmerge::Optimize::MNG::__ANON__[webmerge/scripts/modules/RTP/Webmerge/Optimize/MNG.pm:51] # spent 22µs making 1 call to RTP::Webmerge::Optimize::PNG::__ANON__[webmerge/scripts/modules/RTP/Webmerge/Optimize/PNG.pm:52]
264
265 }
266 # EO each initers
267
268 # return the hash as list
269147µs return %getopts;
270
271}
272# EO sub initConfig
273
274###################################################################################################
275
276# check everything
277sub checkConfig
278
# spent 3.40ms (298µs+3.10) within RTP::Webmerge::checkConfig which was called: # once (298µs+3.10ms) by main::RUNTIME at line 494 of webmerge/scripts/webmerge.pl
{
279
280 # get input variables
28113µs my ($config) = @_;
282
283 # only do the config check once
28413µs return if $config->{'checked'};
285
286 # process all registered checkers
28716µs foreach my $checker (@checkers)
288 {
289 # just call the sub
2907100µs7168µs $checker->($config)
291 }
292 # EO each checkers
293
294 # collect available executables, some programs
295 # may can use multiple executables (like pngopt)
296112µs1116µs collectExecutables($config);
# spent 116µs making 1 call to RTP::Webmerge::collectExecutables
297
298 # check if programs are available
299 # each needs at least one executable
300112µs126µs checkPrograms($config);
# spent 26µs making 1 call to RTP::Webmerge::checkPrograms
301
302 # only check the config once
30315µs $config->{'checked'} = 1;
304
305 # collect output information
306110µs12.79ms collectOutputs($config);
# spent 2.79ms making 1 call to RTP::Webmerge::collectOutputs
307
308 # return success
309127µs return $config;
310
311}
312# EO sub checkConfig
313
314###################################################################################################
315
316# call a program with a file
317# also accept files array ref
318sub runProgram ($$$$;$)
319{
320
321 # get input variables
322 my ($config, $program, $files, $pattern, $options) = @_;
323
324 # get the collected executables
325 my $executables = $programs{$program};
326
327 # check if we requested a valid program (typo?)
328 die "program $program not defined" unless $executables;
329
330 # process all executables found for this program
331 for (my $i = 0; $i < scalar(@{$executables}); $i++)
332 {
333
334 # get options for executable and absolute path
335 my ($tmpl, $executable) = @{$executables->[$i]};
336
337 if (ref($tmpl) eq 'CODE')
338 {
339
340 # print a status message for execution
341 printf "call %s on %s (%d files)\n",
342 $program, $pattern, scalar(@{$files});
343
344 # process file or all files
345 foreach my $file (@{$files || [$files]})
346 {
347
348 # execute the function
349 my $rv = $tmpl->($file, $config, $options);
350
351 # give a warning if the executable returned an error
352 warn "$program execution did not complete successfully\n"
353 . " # " . join(' ', $program, $file) unless $rv;
354
355 }
356 # EO each file
357
358 }
359 else
360 {
361
362 # init level from config value
363 my $lvl = $config->{'level'};
364
365 # get the optimization level from cmd
366 $lvl = $1 if $tmpl =~ m/(\-o?[0-9])/i;
367
368 # print a status message for execution
369 printf "exec %s (%s) on %s (%d files)\n",
370 $executable, $lvl, $pattern, scalar(@{$files});
371
372 # process file or all files
373 foreach my $file (@{$files || [$files]})
374 {
375
376 # execute the executable (sprintf filename into commands)
377 my $rv = system join(' ', $executable, sprintf($tmpl, $file, $file));
378
379 # give a warning if the executable returned an error
380 warn "executable execution did not complete successfully\n"
381 . " # " . join(' ', $executable, sprintf($tmpl, $file, $file)) if $rv;
382
383 }
384 # EO each file
385
386 }
387
388 }
389 # EO each program executable
390
391}
392# EO sub runProgram
393
394###################################################################################################
395
396# childrens
39713µsmy @pids;
398
399# call a program with a file
400# also accept files array ref
401sub callProgram ($$$$;$)
402{
403
404 # get input variables
405 my ($config, $program, $files, $pattern, $options) = @_;
406
407 # make array items unqiue
408 @{$files} = uniq(@{$files});
409
410 # do not run in parallel on windows
411 # code has been developed for linux
412 if ($^O eq "MSWin32")
413 {
414
415 # run the program with a set of all files
416 runProgram($config, $program, $files, $pattern, $options);
417
418 }
419 else
420 {
421
422 # children files
423 my (@files);
424
425 # create an array with all indexes
426 my @indexes = (0 .. $#{$files});
427
428 # return immediately if nothing to do
429 return if scalar @indexes == 0;
430
431 # loop all jobs to distribute files
432 for(my $j = 0; $j < $config->{'jobs'}; $j ++)
433 {
434 # distribute files accross all available jobs
435 $files[$j] = [ @{$files}[grep { $_ % $config->{'jobs'} == $j } @indexes] ];
436 }
437
438 # do not wait for children
439 # local $SIG{CHLD} = 'IGNORE';
440
441 my $parent_pid = $$;
442
443 # hook into termination signal
444 # this is the default sent by kill
445 local $SIG{INT} =
446 local $SIG{TERM} =
447 sub
448 {
449
450 # print a debug message
451 if ($parent_pid == $$)
452 {
453 print "\n";
454 print "ABORT EXTERNAL PROGRAM \n";
455 print "WAITING FOR CHILDREN\n";
456 }
457
458 # wait for all jobs to finish
459 foreach (@pids)
460 {
461 next unless $_;
462 kill 'TERM', $_;
463 waitpid ($_, 0);
464 $_ = undef;
465 }
466
467 # exit now
468 exit;
469
470 };
471
472 # loop all jobs to start commands on files
473 for(my $j = 0; $j < $config->{'jobs'}; $j ++)
474 {
475
476 # fork a child
477 my $pid = fork();
478
479 # os error
480 if (not defined $pid)
481 {
482 die "resources not avilable for fork";
483 }
484 # this is the child
485 elsif ($pid == 0)
486 {
487
488 # set process group
489 setpgrp(0,0);
490
491 # run the program with a subset of files
492 runProgram($config, $program, $files[$j], $pattern, $options);
493
494 # stop child
495 exit(0);
496
497 }
498 # this is the parrent
499 else
500 {
501 # add child pid
502 push @pids, $pid;
503 }
504
505 }
506 # EO forking jobs
507
508 # wait for all jobs to finish
509 foreach (@pids)
510 {
511 next unless $_;
512 waitpid ($_, 0);
513 $_ = undef;
514 }
515
516 }
517
518}
519# EO sub callProgram
520
521###################################################################################################
522
523# make sure to kill children
524END
525
# spent 14µs within RTP::Webmerge::END which was called: # once (14µs+0s) by main::RUNTIME at line 0 of webmerge/scripts/webmerge.pl
{
526 # wait for all jobs to finish
527127µs foreach (@pids)
528 {
529 next unless $_;
530 kill ($_);
531 $_ = undef;
532 }
533}
534# EO END Block
535
536###################################################################################################
537
538sub callProcessor
539
# spent 347s (3.82ms+347) within RTP::Webmerge::callProcessor which was called 74 times, avg 4.69s/call: # 18 times (722µs+326s) by RTP::Webmerge::Merge::__ANON__[/home/ocbnet/domain/ocbnet.ch/vhost/webmerge/htdocs/webmerge/scripts/modules/RTP/Webmerge/Merge.pm:480] at line 455 of webmerge/scripts/modules/RTP/Webmerge/Merge.pm, avg 18.1s/call # 18 times (1.19ms+21.0s) by RTP::Webmerge::Merge::writer at line 98 of webmerge/scripts/modules/RTP/Webmerge/Merge.pm, avg 1.17s/call # 18 times (1.15ms+34.2ms) by RTP::Webmerge::Merge::__ANON__[/home/ocbnet/domain/ocbnet.ch/vhost/webmerge/htdocs/webmerge/scripts/modules/RTP/Webmerge/Merge.pm:480] at line 454 of webmerge/scripts/modules/RTP/Webmerge/Merge.pm, avg 1.96ms/call # 18 times (700µs+16.1ms) by RTP::Webmerge::Merge::__ANON__[/home/ocbnet/domain/ocbnet.ch/vhost/webmerge/htdocs/webmerge/scripts/modules/RTP/Webmerge/Merge.pm:480] at line 456 of webmerge/scripts/modules/RTP/Webmerge/Merge.pm, avg 932µs/call # 2 times (54µs+0s) by RTP::Webmerge::Merge::collect at line 245 of webmerge/scripts/modules/RTP/Webmerge/Merge.pm, avg 27µs/call
{
540
541 # get input variables
54274556µs my ($processors, $data, $config, $item) = @_;
543
544 # do nothing on void input
545741.06ms return unless $processors;
546
547 # call each processor (split string by whitespace)
548321.22ms foreach my $processor (split(/\s+/, $processors))
549 {
550
551 # assert that the selected processor is available
55232226µs die "unknown processor $processor" unless $processors{$processor};
553
554 # call the processor with the given data to alter
55532775µs32347s $processors{$processor}->($data, $config, $item) or die "processor failed";
# spent 326s making 24 calls to RTP::Webmerge::Process::CSS::Spritesets::spritesets, avg 13.6s/call # spent 21.0s making 8 calls to RTP::Webmerge::Process::CSS::Inlinedata::inlinedata, avg 2.63s/call
556
557 }
558 # EO each processor
559
560}
561# EO sub callProcessor
562
563###################################################################################################
564###################################################################################################
565121µs1;
 
# spent 4µs within RTP::Webmerge::CORE:sort which was called: # once (4µs+0s) by RTP::Webmerge::collectExecutables at line 204
sub RTP::Webmerge::CORE:sort; # opcode