RFR: 8370438: Offer link time optimization support on library level [v10]
Sergey Bylokhov
serb at openjdk.org
Sun Nov 23 22:57:35 UTC 2025
On Fri, 7 Nov 2025 15:06:51 GMT, Matthias Baesken <mbaesken at openjdk.org> wrote:
>> We currently have support for LTO (link time optimization) for Hotspot/libjvm, that can be enabled as a JVM feature.
>> But for other JDK native libs, we do not have support for this feature.
>> LTO and sometimes lead to faster and also in some cases smaller binaries, so support for this might be interesting also for other libs and not only libjvm.
>
> Matthias Baesken has updated the pull request incrementally with one additional commit since the last revision:
>
> Add lto to EXTRA_FLAGS, not to OPT
Marked as reviewed by serb (Reviewer).
here is my finding, no issues were found by the tests:
Platform / Compiler | Before | After | Win (number) | Win (%)
-- | -- | -- | -- | --
Windows, VS 2022 | 204 800 | 206 848 | −2 048 | −1.00%
macOS, Xcode 14.3.1 | 335 664 | 219 568 | 116 096 | 34.57%
macOS, Xcode 26 | 391 168 | 237 360 | 153 808 | 39.32%
gcc 13.3.0 | 307 936 | 219 344 | 88 592 | 28.77%
gcc 11.4.0 | 303 944 | 174 168 | 129 776 | 42.70%
gcc 11.5.0 | 295 280 | 177 360 | 117 920 | 39.93%
-------------
PR Review: https://git.openjdk.org/jdk/pull/27976#pullrequestreview-3498070608
PR Comment: https://git.openjdk.org/jdk/pull/27976#issuecomment-3568427441
More information about the build-dev
mailing list