spring-boot - 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.
解决方案
我已经尝试过 Afterburner 模块,但我并没有注意到性能上有太多(或实际上任何)改进。也许 Spring 已经在使用它,或者其他优化。环顾一圈后,我了解了 Kryo,这似乎有所帮助。
如果没有其他人提出建议,我将不得不接受我自己的答案,但我会稍等片刻。
推荐阅读
- perl - Perl 哈希解引用
- python - 使用 pptx 无需先将输出保存到 jpg 文件
- tensorflow - 用 Keras 合并两层
- angular - Azure Active Directory 注销与 ADAL 库。角,打字稿
- php - Nginx 发生错误。抱歉,您要查找的页面目前不可用
- javascript - JQuery移动IOS设备如何删除网页上的默认滚动
- ruby - 使用 Rspec 测试图像
- python - 如何在 for 循环中堆叠多个 pandas DataFrame
- vb.net - 获取数据库中最后插入的主键记录
- javascript - 你如何解决“connection.play 不是函数”?