# Exploring why native executables produced with Mandrel 23.0 are bigger than those produced with Mandrel 22.3

DevFeed: [Exploring why native executables produced with Mandrel 23.0 are bigger than those produced with Mandrel 22.3](<https://devfeed.tech/articles/exploring-why-native-executables-produced-with-mandrel-23-0-are-bigger-than-those-produced-with-mandrel-22-3-43624.md>)

Original publisher: [Read original article](<https://quarkus.io/blog/mandrel-23-0-image-size-increase/>)

Author: Foivos Zakkak (https://twitter.com/zakkak)

Published: 2023-11-02T00:00:00Z

Content type: article

Language: en

Sources: [Quarkus - Supersonic Subatomic Java](<https://devfeed.tech/sources/quarkus-supersonic-subatomic-java.md>)

Topics: [Quarkus](<https://devfeed.tech/topics/quarkus.md>), [gdb](<https://devfeed.tech/topics/gdb.md>), [Code](<https://devfeed.tech/topics/code.md>), [Monitoring](<https://devfeed.tech/topics/monitoring.md>), [version](<https://devfeed.tech/topics/version.md>), [intel](<https://devfeed.tech/topics/intel.md>)

Tags: [bugfixes](<https://devfeed.tech/tags/bugfixes.md>), [gdb](<https://devfeed.tech/tags/gdb.md>), [inlining](<https://devfeed.tech/tags/inlining.md>), [intel](<https://devfeed.tech/tags/intel.md>), [monitoring](<https://devfeed.tech/tags/monitoring.md>), [profiling](<https://devfeed.tech/tags/profiling.md>), [quarkus](<https://devfeed.tech/tags/quarkus.md>), [time](<https://devfeed.tech/tags/time.md>)

## AI overview

This article analyzes why native executables built with Mandrel 23.0 are larger than those built with Mandrel 22.3 after Quarkus 3.2 changed the default Mandrel version. It attributes the increase to changes involving reflection-method constant folding, serial GC write barriers, and code alignment for an Intel processor erratum.

## Source excerpt

Starting with Quarkus 3.2 the default Mandrel version was updated from 22.3 to 23.0. This update brought a number of bugfixes as well as new features like: Better support for profiling and debugging using perf and gdb. Finer control over the monitoring features included in the native executable. Support for more JFR events. However, it also brought an unwanted side effect. The native executables produced with Mandrel 23.0 are bigger than the ones produced with Mandrel 22.3. To better understand why that happens we perform a thorough analysis to attribute the size increase to specific changes in Mandrel's code base. TL;DR According to our analysis the binary size increase is attributed to three distinct changes, all of which are well justified: Skipping constant folding of reflection methods with side effects. Reducing the number of stores that are executed by the serial GC write barriers to improve performance by reducing the number of cache misses. Enabling code alignment to compensate for the performance penalty of Intel's jump conditional code erratum. Better understanding what is different between the generated native executables The first step in our analysis is to understand where the binary size increase comes from. Usually such an increase is attributed to one of the following: More code being generated, due to more code becoming reachable. More code being generated, due to more aggressive inlining. More data being stored in the image heap, due to more objects being reachable. More data being stored in the image heap, due to more types being registered for reflection thus requiring more code metadata to be stored. To perform the analysis we use the Quarkus startstop test (specifically commit a8bae846881607e376c7c8a96116b6b50ee50b70) which generates, starts, tests, and stops small Quarkus applications and measures various time-related metrics (e.g. time-to-first-OK-request) and memory usage. We get the test with: git clone https://github.com/quarkus-qe/quarku