building libjvm with -Os for space optimization - was : RE: RFR: 8234525: enable link-time section-gc for linux s390x to remove unused code

August Nagro augustnagro at gmail.com
Wed Dec 18 18:39:22 UTC 2019


> (btw I wonder how much effect  profile guided optimization would bring in
your experiments )

That's good idea; I'm also curious about PGO. I know some apps get 10-20%
performance boost, however setting up PGO is pretty inconvenient. But maybe
having it run over the DaCapo / Renaissance benchmarks would make a good
profile.

I also used some flags that OpenJDK could pickup, like
`-fomit-frame-pointer` on non-debug builds. I also haven't had any problems
running with the higher optimization, Ofast.

> What alternatives do you have in mind?

There are many opportunities I think. One way would be to allow jar / jmod
files to use a modern compression algorithm (like LZ4). Not only would
distributions be smaller but probably faster as well, since the cost of IO
>> decompression in many cases. The size of OpenJDK's jar/jmod files is
much larger than libjvm.so. And this isn't my idea, I saw it on Aleksey
Shiplev's twitter some time ago:
https://twitter.com/shipilev/status/1100396679285665794

On Wed, Dec 18, 2019 at 10:07 AM Baesken, Matthias <matthias.baesken at sap.com>
wrote:

>
>
>    - I compiled with clang since I'm on Mac.
>    -
>
>
>
> Thanks for clarifying, that’s what I thought .
>
>
>
> (btw I wonder how much effect  profile guided optimization would bring in
> your experiments )
>
>
>
>
>
>    - My opinion is that there are probably more compelling alternatives
>    if reducing binary size is the goal. Even if the tests show that Os/O2 is
>    no different than O3,
>    - who knows if this will be true in the future.
>    -
>
>
>
> What alternatives do you have in mind ?
>
>
>
> Best regards, Matthias
>
>
>
>
>
> *From:* August Nagro <augustnagro at gmail.com>
> *Sent:* Mittwoch, 18. Dezember 2019 14:42
> *To:* Baesken, Matthias <matthias.baesken at sap.com>
> *Cc:* claes.redestad at oracle.com; Doerr, Martin <martin.doerr at sap.com>;
> erik.joelsson at oracle.com; build-dev at openjdk.java.net;
> hotspot-dev at openjdk.java.net
> *Subject:* Re: RE: building libjvm with -Os for space optimization - was
> : RE: RFR: 8234525: enable link-time section-gc for linux s390x to remove
> unused code
>
>
>
> I compiled with clang since I'm on Mac.
>
>
>
> The Renaissance benchmark suite is also a good one that I learned about
> recently.
>
>
>
> My opinion is that there are probably more compelling alternatives if
> reducing binary size is the goal. Even if the tests show that Os/O2 is no
> different than O3, who knows if this will be true in the future.
>
>
>
> Regards,
>
>
>
> - August
>
>
>
> On Wed, Dec 18, 2019, 1:58 AM Baesken, Matthias <matthias.baesken at sap.com>
> wrote:
>
> Hi August , thanks for pointing to your webpage,  very interesting !
>
> We did our builds+tests/benchmarks  with  gcc  7.4.0   , what
> compiler+version did you use?
>
> Probably I should look a bit more into Dacapo (we used that one in the
> past too sometimes).
>
> Best regards, Matthias
>
>
> >
> > I published some benchmarks of OpenJDK on Mac with Ofast and O3 [1].
> > Some microbenchmarks like Netty’s HttpObjectEncoder experienced >100%
> > speedup with O3, and the more real-world Dacapo suite was ~15%
> > improvement over O2 (which is exactly the same as Os). I did include a
> few
> > other flags, however the speedup was primarily due to optimization level.
> >
> > Building with Os is the old wisdom. It used to be the case that many
> programs
> > would be faster with the smaller binary size, but this is almost never
> the case
> > nowadays.
> >
> > - August
> >
> > [1]: http://august.nagro.us/optimized-openjdk.html
>
>



More information about the build-dev mailing list