On Tue, 11 Feb 2025 15:56:39 GMT, Matthias Baesken <mbaes...@openjdk.org> wrote:
> The libjdwp is currently built with LOW optimization level, it could be built > with SIZE optimization to lower the lib size by ~ 10 % on UNIX. > On Windows LOW and SIZE currently translate to the same O1 optimization flag > so no difference there. > > On Linux x86_64 for example the lib shrinks from > 300K to 268K and the debuginfo file shrinks from 1.9M to 1.7M . > > On Linux ppc64le for example the lib shrinks from > 428K to 368K and the debuginfo file shrinks from 2.0M to 1.7M . When minimalVM support was added, before the current configure based build system, choosing minmalVM did two things: it omitted some hotspot features from the JVM (like JVMTI, and libjdwp.so as a consequence) and it compiled many files with Os instead of O2 or O3. I think it still works like that with the current build system, but I'm not certain. A lot of benchmarking was done to avoid using Os for files that were important for overall performance, but some performance impact was allowed. After all, choosing minimalVM was in part a size vs performance choice, so having some performance hit in order to reduce the size was acceptable. We just tried to minimize the performance lost by being smart about which files were compiled with -Os. My point here is that if you want small footprint, you can choose that, and expect some performance hit as a result, but this footprint/performance choice should be just that, a choice (like choosing minimalVM). You are suggesting potentially sacrificing some performance for reduced footprint (and a tiny footprint reduction at that) without it being a choice. Yes, Liberica does care about footprint, but they are making sacrifices to reduce the footprint because they have small footprint goals that in part outweigh some performance or functionality goals. This is akin to the minimalVM approach. If anything, useful build system support for Liberica would come in the way of making it configurable whether libjdwp.so (and other libs) are built for size or built for performance. ------------- PR Comment: https://git.openjdk.org/jdk/pull/23563#issuecomment-2675333759