[Libreoffice] [GSoC] link-time optimization

Matúš Kukan matus.kukan at gmail.com
Mon Aug 22 05:26:08 PDT 2011


On 22 August 2011 13:22, Michael Meeks <michael.meeks at novell.com> wrote:
> Hi Matus,
>
> On Sat, 2011-08-20 at 23:04 +0200, Matúš Kukan wrote:
>> I created patch, which allows link-time optimization (--enable-lto)
>> for shared libraries, you need at least gcc-4.5 (I'm not checking for
>> version in configure).
>
>        Patch looks great to me :-)
>
>> I don't know what should I try to test
>> if it is really faster and how much.
>
>        Heh ;-) so a 'callgrind' run on startup would be one approach:
>
> export OOO_EXIT_POST_STARTUP=1
> export OOO_DISABLE_RECOVERY=1
> valgrind --tool=callgrind --simulate-cache=yes --dump-instr=yes ./soffice.bin -writer --splash-pipe=0
>
Unfortunately, I can't try this anymore, I lost my build by mistake.

>        And then look at the total number of simulated cycles I guess. On the
> other hand it would be perhaps easier, and more interesting to see if
> the code is actually smaller ;-) what is the size before and after of
> the writer library eg. ?
>
Heh :), actually the opposite.
I remember it was 15MB after lto, normally it's 10 MB.
Maybe It's complete wrong with gcc-4.5 or it is doing aggressive
inlining or I don't know what.

>> Most of the time is running lto1 executable and it eat cca
>> 2GB RAM when optimizing sw library. (cca 4,5 minutes for me)
>
>        :-) Of course, if we can get some real wins with it (particularly
> putting more code into one big library), then a bit more link time is a
> price well worth paying I think.
>
>        I suspect most of the bigger wins come from getting as much as possible
> of the code integrated together into one big, mozilla-style library
> but ... :-) lets see.
>
Unfortunately this is not now possible or not easily. We need bigger tail_build.
I will write another mail about this.

Patch for lto is pushed.

Matúš


More information about the LibreOffice mailing list