[Libreoffice] [Patch] Accelerate Perl installer builder

Jan Darmochwal jdarmochwal at gmx.de
Thu Jan 27 13:32:39 PST 2011


On 2011-01-27 Christian Lohmaier wrote:

> So my question is: Did you just skim over the installer to identify
> the part that is slow, or did you profile it yourself? And how did you
> measure the improvement?

I added "-d:DProf" to the perl calls in ooinstall to profile it.

I measured the improvement with the profiler as well. The cumulated
time for collect_directories_from_filesarray went down from 9.7 s to
1.2 s when running make_installer.pl for LibreOffice_SDK (far less
improvement for LibreOffice).

> (and did you also try different variants of the regex handling, like
> incorporating the
> $longlist =~ s/\s*,\s*/,/g;
> 
> into the split? /\s*(,\s*)+/

That takes about 3 times as long.

> I also kind of wonder why there is a hash involved instead of just
> using an array to begin with - as only the keys are used anyway. Is
> using a hash really faster?

The hash is used to remove any duplicates (all keys in a hash are
unique).

> (well, then again I don't think that the longlist part is what
> accounts for the massive speedup - or does it?)

No, it doesn't (saves about 1 second from of a total of 8). Most of
the speedup probably comes from concatenating strings with "a .= b"
instead of "a = a . b".


More information about the LibreOffice mailing list