ooo-build r14834 - in trunk: . doc patches/dev300



Author: michael
Date: Fri Dec 12 15:33:14 2008
New Revision: 14834
URL: http://svn.gnome.org/viewvc/ooo-build?rev=14834&view=rev

Log:
2008-12-12  Michael Meeks  <michael meeks novell com>

        * patches/dev300/speed-make-installer-2.diff,
        * patches/dev300/apply: chop 2 more seconds from
        * make-installer.pl



Added:
   trunk/patches/dev300/speed-make-installer-2.diff
Modified:
   trunk/ChangeLog
   trunk/doc/installer.txt
   trunk/patches/dev300/apply

Modified: trunk/doc/installer.txt
==============================================================================
--- trunk/doc/installer.txt	(original)
+++ trunk/doc/installer.txt	Fri Dec 12 15:33:14 2008
@@ -1,84 +1,49 @@
 ** make_installer.pl slowness **
 
-Use -d:DProf
+Use -d:DProf & dprofpp:
 
+---- installer::setupscript.pm::get_all_items_from_script ----
 
-The modulegids_for_itemgid problem is simple:
-	+ we have lists of files in each module,
-	+ but not lists of modules for each file
-		+ we try to fix this.
-	+ unfortunately the order of this is extremely high.
-	+ surely better to:
-		+ walk this backwards: foreach module
-			+ split & append item name to each gid ...
-
++ one of the worst parsers I've -ever- seen
+	+ initially - it read lots of lines multiple times [!]
+	+ the solution is:
+		+ write a good parser instead [!]
+		+ call it just once for the whole file.
+		+ use simpler regexps
 
-Before:
+---- installer::setupscript::replace_all_setupscriptvariables_in_script ----
 
-Total Elapsed Time = 40.09854 Seconds
-  User+System Time = 17.76854 Seconds
-Exclusive Times
-%Time ExclSec CumulS #Calls sec/call Csec/c  Name
- 45.9   8.158  8.168   1025   0.0080 0.0080  installer::scriptitems::get_string
-                                             _of_modulegids_for_itemgid
- 13.2   2.360  2.640      8   0.2950 0.3300  installer::setupscript::get_all_it
-                                             ems_from_script
- 11.8   2.110  2.110      1   2.1100 2.1099  installer::setupscript::replace_al
+before:
+ 33.4   2.030  2.030      1   2.0300 2.0300  installer::setupscript::replace_al
+                                             l_setupscriptvariables_in_script
+to:
+ 6.43   0.240  0.240      1   0.2400 0.2400  installer::setupscript::replace_al
                                              l_setupscriptvariables_in_script
- 5.45   0.968  0.968    787   0.0012 0.0012  installer::converter::convert_stri
-                                             nglist_into_hash
- 3.55   0.630  0.630     36   0.0175 0.0175  installer::scpzipfiles::replace_al
-                                             l_ziplistvariables_in_file
- 2.96   0.526  0.561      1   0.5257 0.5613  installer::archivefiles::resolving
-                                             _archive_flag
- 2.32   0.413  1.375      1   0.4133 1.3752  installer::scriptitems::collect_di
-                                             rectories_from_filesarray
- 1.58   0.281  0.281  54532   0.0000 0.0000  installer::remover::remove_leading
-                                             _and_ending_quotationmarks
- 1.28   0.228  0.228   1018   0.0002 0.0002  installer::scriptitems::get_Direct
-                                             oryname_From_Directorygid
- 1.07   0.190  0.220     44   0.0043 0.0050  installer::packagelist::get_packin
-                                             fo
- 0.92   0.164  0.164   2754   0.0001 0.0001  installer::existence::exists_in_ar
-                                             ray
- 0.84   0.149  0.336     62   0.0024 0.0054  main::BEGIN
- 0.82   0.145  0.145   1333   0.0001 0.0001  installer::systemactions::read_com
-                                             plete_directory
- 0.73   0.130  0.130     84   0.0015 0.0015  installer::files::read_file
- 0.56   0.100  0.100    106   0.0009 0.0009  installer::scriptitems::get_langua
-                                             gespecific_module
 
-After:
+	just by switching to one big string.
+
+---- installer::scriptitems::get_string_of_modulegids_for_itemgid ----
+
+Before:
 
-Total Elapsed Time = 30.53867 Seconds
-  User+System Time = 9.308677 Seconds
-Exclusive Times
 %Time ExclSec CumulS #Calls sec/call Csec/c  Name
- 24.8   2.313  2.425      8   0.2891 0.3032  installer::setupscript::get_all_it
-                                             ems_from_script
- 22.3   2.080  2.080      1   2.0799 2.0799  installer::setupscript::replace_al
-                                             l_setupscriptvariables_in_script
- 9.75   0.908  0.908    787   0.0012 0.0012  installer::converter::convert_stri
-                                             nglist_into_hash
- 6.77   0.630  0.630     36   0.0175 0.0175  installer::scpzipfiles::replace_al
-                                             l_ziplistvariables_in_file
- 6.28   0.585  0.589      1   0.5846 0.5892  installer::archivefiles::resolving
-                                             _archive_flag
- 3.57   0.332  1.291      1   0.3317 1.2914  installer::scriptitems::collect_di
-                                             rectories_from_filesarray
- 2.76   0.257  0.257   1018   0.0003 0.0003  installer::scriptitems::get_Direct
-                                             oryname_From_Directorygid
- 1.83   0.170  0.200     44   0.0039 0.0045  installer::packagelist::get_packin
-                                             fo
- 1.75   0.163  0.163   1336   0.0001 0.0001  installer::systemactions::read_com
-                                             plete_directory
- 1.71   0.159  0.355     62   0.0026 0.0057  main::BEGIN
- 1.54   0.143  0.143   2754   0.0001 0.0001  installer::existence::exists_in_ar
-                                             ray
+ 45.9   8.158  8.168   1025   0.0080 0.0080  installer::scriptitems::get_string_of_modulegids_for_itemgid
 
 
+After: vanished ...
+
 + why is it so bad ?
 
+The modulegids_for_itemgid problem is simple:
+	+ we have lists of files in each module,
+	+ but not lists of modules for each file
+		+ we try to fix this.
+	+ unfortunately the order of this is extremely high.
+	+ surely better to:
+		+ walk this backwards: foreach module
+			+ split & append item name to each gid ...
+
+
 --------
 
 * 20 seconds ++
@@ -132,3 +97,70 @@
   1215650   0.11160  10.78000  2379:  my $allitems = "";
   1215650   4.33675  20.69000  2383:  if ( $allitems =~ /\b$itemgid\b/i )
   1816320   0.74356  20.19000   337:   $newhash{$key} = ${$oldcollector}[$i]-
+
+
+New:
+
+... analyzing directories ... 
+return 313 items for 'Directory'
+... analyzing files ... 
+return 981 items for 'File'
+... analyzing scpactions ... 
+return 34 items for 'ScpAction'
+... analyzing shortcuts ... 
+return 8 items for 'Shortcut'
+... analyzing unix links ... 
+return 2 items for 'Unixlink'
+... analyzing profile ... 
+return 12 items for 'Profile'
+... analyzing profileitems ... 
+return 105 items for 'ProfileItem'
+... analyzing modules ... 
+return 1198 items for 'Module'
+
+before:
+... analyzing directories ... 
+return 313 items for 'Directory'
+... analyzing files ... 
+return 981 items for 'File'
+... analyzing scpactions ... 
+return 34 items for 'ScpAction'
+... analyzing shortcuts ... 
+return 8 items for 'Shortcut'
+... analyzing unix links ... 
+return 2 items for 'Unixlink'
+... analyzing profile ... 
+return 12 items for 'Profile'
+... analyzing profileitems ... 
+return 105 items for 'ProfileItem'
+... analyzing modules ... 
+return 1198 items for 'Module'
+
+
+Total Elapsed Time = 14.82739 Seconds
+  User+System Time = 6.077393 Seconds
+Exclusive Times
+%Time ExclSec CumulS #Calls sec/call Csec/c  Name
+ 35.3   2.149  2.298      8   0.2686 0.2872  installer::setupscript::get_all_it
+                                             ems_from_script
+ 33.4   2.030  2.030      1   2.0300 2.0300  installer::setupscript::replace_al
+                                             l_setupscriptvariables_in_script
+ 5.25   0.319  0.693     63   0.0051 0.0110  main::BEGIN
+ 4.23   0.257  0.257    482   0.0005 0.0005  installer::systemactions::read_com
+                                             plete_directory
+ 3.95   0.240  0.240      2   0.1200 0.1200  installer::scpzipfiles::replace_al
+                                             l_ziplistvariables_in_file
+ 2.65   0.161  0.161   2453   0.0001 0.0001  installer::existence::exists_in_ar
+                                             ray
+ 2.30   0.140  0.140      5   0.0280 0.0280  installer::files::read_file
+ 2.14   0.130  0.130  54248   0.0000 0.0000  installer::remover::remove_leading
+                                             _and_ending_quotationmarks
+ 1.15   0.070  0.070      1   0.0700 0.0700  installer::scriptitems::resolve_al
+                                             l_directory_names
+ 0.99   0.060  0.257      5   0.0120 0.0514  installer::exiter::BEGIN
+ 0.81   0.049  0.049  11694   0.0000 0.0000  installer::scriptitems::insert_for
+                                             _item
+ 0.66   0.040  0.197     17   0.0023 0.0116  installer::worker::BEGIN
+ 0.59   0.036  0.056   1007   0.0000 0.0001  installer::scriptitems::get_string
+
+

Modified: trunk/patches/dev300/apply
==============================================================================
--- trunk/patches/dev300/apply	(original)
+++ trunk/patches/dev300/apply	Fri Dec 12 15:33:14 2008
@@ -442,8 +442,9 @@
 jpegc.c.diff, i#80674, n#272574, flr
 
 [ Fixes ]
-# speed up make_installer.pl by ~25%
+# speed up make_installer.pl quite markedly.
 speed-make-installer.diff, i#97124, michael
+speed-make-installer-2.diff, i#97124, michael
 
 # process relative SMB paths (in hyperlinks) correctly
 tools-urlobj-smb-scheme-patch.diff, n#261623, flr

Added: trunk/patches/dev300/speed-make-installer-2.diff
==============================================================================
--- (empty file)
+++ trunk/patches/dev300/speed-make-installer-2.diff	Fri Dec 12 15:33:14 2008
@@ -0,0 +1,61 @@
+diff -u -r solenv/bin-pristine/make_installer.pl solenv/bin/make_installer.pl
+--- solenv/bin-pristine/make_installer.pl	2008-11-25 19:22:01.000000000 +0000
++++ solenv/bin/make_installer.pl	2008-12-12 15:25:33.000000000 +0000
+@@ -382,7 +382,7 @@
+ installer::setupscript::resolve_lowercase_productname_setupscriptvariable($allscriptvariablesref);
+ if ( $installer::globals::globallogging ) { installer::files::save_file($loggingdir . "setupscriptvariables3.log" ,$allscriptvariablesref); }
+ 
+-installer::setupscript::replace_all_setupscriptvariables_in_script($setupscriptref, $allscriptvariablesref);
++$setupscriptref = installer::setupscript::replace_all_setupscriptvariables_in_script($setupscriptref, $allscriptvariablesref);
+ if ( $installer::globals::globallogging ) { installer::files::save_file($loggingdir . "setupscript2.log" ,$setupscriptref); }
+ 
+ # Adding all variables defined in the installation object into the hash of all variables.
+
+diff -u -r solenv/bin-pristine/modules/installer/setupscript.pm solenv/bin/modules/installer/setupscript.pm
+--- solenv/bin-pristine/modules/installer/setupscript.pm	2008-11-25 19:21:57.000000000 +0000
++++ solenv/bin/modules/installer/setupscript.pm	2008-12-12 15:23:27.000000000 +0000
+@@ -248,23 +248,31 @@
+ 		}
+ 	}
+ 
+-	for ( my $i = 0; $i <= $#{$scriptref}; $i++ )
++	# This is far faster than running a regexp for each line
++	my $bigstring = '';
++	for my $line (@{$scriptref}) {
++	    $bigstring = $bigstring . $line;
++	}
++	foreach my $key ( keys %subs )
+ 	{
+-		my $line = ${$scriptref}[$i];
+-
+-		if ( $line =~ /^.*\%\w+.*$/ )	# only oif "%" occurs
+-		{
+-			# Attention: It must be possible to substitute "%PRODUCTNAMEn", "%PRODUCTNAME%PRODUCTVERSIONabc"
++	    # Attention: It must be possible to substitute "%PRODUCTNAMEn", "%PRODUCTNAME%PRODUCTVERSIONabc"
++	    my $value = $subs{$key};
++	    $bigstring =~ s/$key/$value/g;
++	}
++	my @newlines = split /\n/, $bigstring;
++	$scriptref = \ newlines;
+ 
+-			foreach my $key ( keys %subs )
+-			{
+-				my $value = $subs{$key};
+-				$line =~ s/$key/$value/g;
+-				${$scriptref}[$i] = $line;
+-			}
+-		}
++	# now check for any mis-named '%' variables that we have left
++	my $num = 0;
++	for my $check (@newlines) {
++	    $num++;
++	    if ( $check =~ /^.*\%\w+.*$/ ) {
++		print STDERR "Warning: mis-named or un-known '%' variable at line $num:\n$check\n";
++	    }
+ 	}
++
++	return $scriptref;
+ }
+ 
+ #######################################################################
+ # Collecting all items of the type "searchitem" from the setup script



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]