← Index
NYTProf Performance Profile   « block view • line view • sub view »
For C:/lo/libo-master/solenv/bin/make_installer.pl
  Run on Mon Sep 24 00:52:54 2012
Reported on Mon Sep 24 07:34:39 2012

Filename/cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/converter.pm
StatementsExecuted 42438 statements in 357ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
2014144286ms310msinstaller::converter::::convert_stringlist_into_arrayinstaller::converter::convert_stringlist_into_array
207133124.9ms24.9msinstaller::converter::::CORE:regcompinstaller::converter::CORE:regcomp (opcode)
354736.06ms7.57msinstaller::converter::::make_path_conforminstaller::converter::make_path_conform
218222.02ms2.20msinstaller::converter::::convert_stringlist_into_hashinstaller::converter::convert_stringlist_into_hash
332787µs1.55msinstaller::converter::::convert_array_to_hashinstaller::converter::convert_array_to_hash
13211765µs765µsinstaller::converter::::CORE:matchinstaller::converter::CORE:match (opcode)
35411665µs665µsinstaller::converter::::CORE:substinstaller::converter::CORE:subst (opcode)
111362µs371µsinstaller::converter::::BEGIN@30installer::converter::BEGIN@30
811352µs352µsinstaller::converter::::copy_item_objectinstaller::converter::copy_item_object
111224µs1.05msinstaller::converter::::combine_arrays_from_references_first_wininstaller::converter::combine_arrays_from_references_first_win
11118µs37µsinstaller::converter::::BEGIN@31installer::converter::BEGIN@31
11113µs16µsinstaller::converter::::BEGIN@33installer::converter::BEGIN@33
0000s0sinstaller::converter::::convert_array_to_space_separated_stringinstaller::converter::convert_array_to_space_separated_string
0000s0sinstaller::converter::::convert_slash_to_backslashinstaller::converter::convert_slash_to_backslash
0000s0sinstaller::converter::::convert_whitespace_stringlist_into_arrayinstaller::converter::convert_whitespace_stringlist_into_array
0000s0sinstaller::converter::::copy_collectorinstaller::converter::copy_collector
0000s0sinstaller::converter::::replace_masked_separatorinstaller::converter::replace_masked_separator
0000s0sinstaller::converter::::resolve_masked_separatorinstaller::converter::resolve_masked_separator
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1#*************************************************************************
2#
3# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4#
5# Copyright 2000, 2010 Oracle and/or its affiliates.
6#
7# OpenOffice.org - a multi-platform office productivity suite
8#
9# This file is part of OpenOffice.org.
10#
11# OpenOffice.org is free software: you can redistribute it and/or modify
12# it under the terms of the GNU Lesser General Public License version 3
13# only, as published by the Free Software Foundation.
14#
15# OpenOffice.org is distributed in the hope that it will be useful,
16# but WITHOUT ANY WARRANTY; without even the implied warranty of
17# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18# GNU Lesser General Public License version 3 for more details
19# (a copy is included in the LICENSE file that accompanied this code).
20#
21# You should have received a copy of the GNU Lesser General Public License
22# version 3 along with OpenOffice.org. If not, see
23# <http://www.openoffice.org/license.html>
24# for a copy of the LGPLv3 License.
25#
26#*************************************************************************
27
28package installer::converter;
29
30263µs2379µs
# spent 371µs (362+8) within installer::converter::BEGIN@30 which was called: # once (362µs+8µs) by installer::systemactions::BEGIN@32 at line 30
use strict;
# spent 371µs making 1 call to installer::converter::BEGIN@30 # spent 8µs making 1 call to strict::import
31258µs256µs
# spent 37µs (18+19) within installer::converter::BEGIN@31 which was called: # once (18µs+19µs) by installer::systemactions::BEGIN@32 at line 31
use warnings;
# spent 37µs making 1 call to installer::converter::BEGIN@31 # spent 19µs making 1 call to warnings::import
32
3321.44ms220µs
# spent 16µs (13+3) within installer::converter::BEGIN@33 which was called: # once (13µs+3µs) by installer::systemactions::BEGIN@32 at line 33
use installer::globals;
# spent 16µs making 1 call to installer::converter::BEGIN@33 # spent 3µs making 1 call to UNIVERSAL::import
34
35#############################
36# Converter
37#############################
38
39sub convert_array_to_hash
40
# spent 1.55ms (787µs+765µs) within installer::converter::convert_array_to_hash which was called 3 times, avg 517µs/call: # once (369µs+356µs) by installer::run at line 222 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm # once (225µs+217µs) by installer::converter::combine_arrays_from_references_first_win at line 175 # once (193µs+191µs) by installer::converter::combine_arrays_from_references_first_win at line 176
{
411233µs my ($arrayref) = @_;
42
43 my %newhash = ();
44
45 for (@{$arrayref})
46 {
472641.53ms132765µs next unless /^\s*([\w-]+?)\s+(.*?)\s*$/;
# spent 765µs making 132 calls to installer::converter::CORE:match, avg 6µs/call
48 $newhash{$1} = $2;
49 }
50
51 return \%newhash;
52}
53
54#############################################################################
55# Converting a string list with separator $listseparator
56# into an array
57#############################################################################
58
59sub convert_stringlist_into_array
60
# spent 310ms (286+23.8) within installer::converter::convert_stringlist_into_array which was called 20141 times, avg 15µs/call: # 15888 times (157ms+13.0ms) by installer::windows::featurecomponent::create_featurecomponent_table_from_files_collector at line 60 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/windows/featurecomponent.pm, avg 11µs/call # 4251 times (129ms+10.8ms) by installer::windows::idtglobal::addcustomactions at line 1763 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/windows/idtglobal.pm, avg 33µs/call # once (100µs+34µs) by installer::control::check_system_path at line 102 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/control.pm # once (50µs+14µs) by installer::run at line 273 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm
{
6140282342ms my ( $includestringref, $listseparator ) = @_;
62
632014123.8ms return [map "$_\n", split /\Q$listseparator\E\s*/, ${$includestringref}];
# spent 23.8ms making 20141 calls to installer::converter::CORE:regcomp, avg 1µs/call
64}
65
66#############################################################################
67# Converting a string list with separator $listseparator
68# into a hash with values 1.
69#############################################################################
70
71sub convert_stringlist_into_hash
72
# spent 2.20ms (2.02+184µs) within installer::converter::convert_stringlist_into_hash which was called 218 times, avg 10µs/call: # 109 times (1.06ms+83µs) by installer::scriptitems::remove_not_required_spellcheckerlanguage_modules at line 379 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/scriptitems.pm, avg 11µs/call # 109 times (958µs+101µs) by installer::worker::set_spellcheckerlanguages at line 1478 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/worker.pm, avg 10µs/call
{
734362.61ms my ( $includestringref, $listseparator ) = @_;
74
75218184µs return {map {$_, 1} split /\Q$listseparator\E\s*/, ${$includestringref}};
# spent 184µs making 218 calls to installer::converter::CORE:regcomp, avg 845ns/call
76}
77
78#############################################################################
79# Converting a string list with separator $listseparator
80# into an array
81#############################################################################
82
83sub convert_whitespace_stringlist_into_array
84{
85 my ( $includestringref ) = @_;
86
87 my $tmp = ${$includestringref};
88 $tmp = s/^\s+//;
89 $tmp = s/\s+$//;
90
91 return [map "$_\n", split /\s+/, $tmp];
92}
93
94#############################################################################
95# Converting an array into a space separated string
96#############################################################################
97
98sub convert_array_to_space_separated_string
99{
100 my ( $arrayref ) = @_;
101
102 my $newstring;
103 for (@{$arrayref}) {
104 my $tmp = $_;
105 $tmp =~ s/\s+$//;
106 $newstring .= "$tmp ";
107 }
108 $newstring =~ s/ $//;
109
110 return $newstring;
111}
112
113#############################################################################
114# The file name contains for some files "/". If this programs runs on
115# a windows platform, this has to be converted to "\".
116#############################################################################
117
118sub convert_slash_to_backslash
119{
120 my ($filesarrayref) = @_;
121
122 for my $onefile (@{$filesarrayref})
123 {
124 if ( $onefile->{'Name'} ) { $onefile->{'Name'} =~ s/\//\\/g; }
125 }
126}
127
128############################################################################
129# Creating a copy of an existing file object
130# No converter
131############################################################################
132
133sub copy_item_object
134
# spent 352µs within installer::converter::copy_item_object which was called 8 times, avg 44µs/call: # 8 times (352µs+0s) by installer::profiles::add_profile_into_filelist at line 105 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/profiles.pm, avg 44µs/call
{
13516404µs my ($olditemhashref, $newitemhashref) = @_;
136
137 $newitemhashref = {%{$olditemhashref}};
138}
139
140#################################################################
141# Windows paths must not contain the following structure:
142# c:\dirA\dirB\..\dirC
143# This has to be exchanged to
144# c:\dirA\dirC
145#################################################################
146
147sub make_path_conform
148
# spent 7.57ms (6.06+1.51) within installer::converter::make_path_conform which was called 354 times, avg 21µs/call: # 109 times (2.26ms+534µs) by installer::windows::msiglobal::write_summary_into_msi_database at line 732 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/windows/msiglobal.pm, avg 26µs/call # 109 times (2.14ms+621µs) by installer::windows::msiglobal::create_msi_database at line 479 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/windows/msiglobal.pm, avg 25µs/call # 109 times (1.10ms+217µs) by installer::windows::msiglobal::create_msi_database at line 481 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/windows/msiglobal.pm, avg 12µs/call # 20 times (398µs+87µs) by installer::systemactions::create_directories at line 283 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/systemactions.pm, avg 24µs/call # 5 times (110µs+34µs) by installer::windows::mergemodule::merge_mergemodules_into_msi_database at line 352 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/windows/mergemodule.pm, avg 29µs/call # once (28µs+9µs) by installer::windows::msiglobal::include_cabs_into_msi at line 1247 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/windows/msiglobal.pm # once (18µs+6µs) by installer::windows::msiglobal::create_transforms at line 782 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/windows/msiglobal.pm
{
14914168.03ms my ( $path ) = @_;
150 my $s = $installer::globals::separator;
151
1527081.51ms while ($path =~ s/[^\.\Q$s\E]+?\Q$s\E\.\.(?:\Q$s\E|$)//g) {}
# spent 844µs making 354 calls to installer::converter::CORE:regcomp, avg 2µs/call # spent 665µs making 354 calls to installer::converter::CORE:subst, avg 2µs/call
153
154 return $path;
155}
156
157#################################################################
158# Copying an item collector
159# A reference to an array consisting of references to hashes.
160#################################################################
161
162sub copy_collector
163{
164 return [map { {%{$_}} } @{$_[0]}];
165}
166
167#################################################################
168# Combining two arrays, first wins
169#################################################################
170
171sub combine_arrays_from_references_first_win
172
# spent 1.05ms (224µs+827µs) within installer::converter::combine_arrays_from_references_first_win which was called: # once (224µs+827µs) by installer::run at line 213 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm
{
1735216µs my ( $arrayref1, $arrayref2 ) = @_;
174
1751442µs my $hashref1 = convert_array_to_hash($arrayref1);
# spent 442µs making 1 call to installer::converter::convert_array_to_hash
1761384µs my $hashref2 = convert_array_to_hash($arrayref2);
# spent 384µs making 1 call to installer::converter::convert_array_to_hash
177
178 # add key-value pairs from hash1 to hash2 (overwrites existing keys)
179 @{$hashref2}{keys %{$hashref1}} = values %{$hashref1};
180
181 return [map { "$_ $hashref2->{$_}\n" } keys %{$hashref2}];
182}
183
184#################################################################
185# Replacing separators, that are included into quotes
186#################################################################
187
188sub replace_masked_separator
189{
190 my ($string, $separator, $replacementstring) = @_;
191
192 $string =~ s/\\\Q$separator\E/$replacementstring/g;
193
194 return $string;
195}
196
197#################################################################
198# Resolving separators, that were replaced
199# in function mask_separator_in_quotes
200#################################################################
201
202sub resolve_masked_separator
203{
204 my ($arrayref, $separator, $replacementstring) = @_;
205
206 for (@{$arrayref})
207 {
208 s/$replacementstring/$separator/g;
209 }
210}
211
21217µs1;
 
# spent 765µs within installer::converter::CORE:match which was called 132 times, avg 6µs/call: # 132 times (765µs+0s) by installer::converter::convert_array_to_hash at line 47, avg 6µs/call
sub installer::converter::CORE:match; # opcode
# spent 24.9ms within installer::converter::CORE:regcomp which was called 20713 times, avg 1µs/call: # 20141 times (23.8ms+0s) by installer::converter::convert_stringlist_into_array at line 63, avg 1µs/call # 354 times (844µs+0s) by installer::converter::make_path_conform at line 152, avg 2µs/call # 218 times (184µs+0s) by installer::converter::convert_stringlist_into_hash at line 75, avg 845ns/call
sub installer::converter::CORE:regcomp; # opcode
# spent 665µs within installer::converter::CORE:subst which was called 354 times, avg 2µs/call: # 354 times (665µs+0s) by installer::converter::make_path_conform at line 152, avg 2µs/call
sub installer::converter::CORE:subst; # opcode