首页 > 解决方案 > Trying to speed up spring-web endpoint json serialization (afterburner)

问题描述

I am using Spring Boot 1.5.8 and spring-web 4.3.12. I have noticed that, when I make a request for data from one of our REST endpoints, more time is spent on data serialization than the rest of the operation. I have been looking into strategies to speed things up, and I learned about the Jackson Afterburner module. The spring documentation claims that I only need to create a @Bean in a @Configuration class and the ObjectMapper that is created will have that module registered. Unfortunately, after adding the Spring bean, the serialization performance remains unchanged. What am I doing wrong?

Also, if anyone has any other ideas about how to increase the json serialization performance in a Spring REST controller, I would be very interested in hearing about them.

Thanks in advance.

标签: spring-bootjacksonspring-webjackson-modules

解决方案


我已经尝试过 Afterburner 模块,但我并没有注意到性能上有太多(或实际上任何)改进。也许 Spring 已经在使用它,或者其他优化。环顾一圈后,我了解了 Kryo,这似乎有所帮助。

如果没有其他人提出建议,我将不得不接受我自己的答案,但我会稍等片刻。


推荐阅读