Enabling reflection-free Jackson serializers by default
Some time ago, we started experimenting on how to improve the efficiency of JSON serialization and deserialization offered by Jackson and extensively used in Quarkus applications. From a performance point of view, Jackson’s main bottleneck is its heavy reliance on Java reflection to access or populate data objects at runtime. To address this issue, we developed a build-time metaprogramming approach that generates reflection-free serializers and deserializers for Jackson.
In this article we explained how we implemented this feature in Quarkus and the performance improvements it brings. Since then, we have been continuously working to enhance this feature, fix bugs, and improve compatibility with various Jackson features.
Configuring reflection-free Jackson serialization
Given the experimental nature of this feature, we initially made it opt-in. To enable reflection-free Jackson serializers and deserializers in your Quarkus application, it is necessary to add the following configuration to your application.properties file:
quarkus.rest.jackson.optimization.enable-reflection-free-serializers=true
In the past months an increasing number of users have tried this feature, taking advantage of the performance benefits it offers, but also helping us to discover bugs, edge cases, and compatibility issues with various Jackson features that we have addressed one by one. Overall, we have received positive feedback from the community, so we have decided to make the obvious next step.
Enabling by default in the Quarkus 3.35 release
At the moment the entire Quarkus test suite is passing with this feature enabled, and we have addressed all compatibility issues reported by users so far. Therefore, we have decided to enable this feature by default in the next Quarkus 3.35 release.
In order to cover the broadest possible range of use cases, we invite you to test your applications with this feature enabled, possibly also measuring its impact on performances. If you encounter any issues or have feedback, please report them on our GitHub repository or reach out to us on the Quarkus community channels. This will help us to be more confident about the stability of this feature and ensure a smooth transition for all users.