简体   繁体   中英

Jackson to convert object to json string

I am using Jackson to convert Java POJO to JSON string. The problem I am facing is that as the number of requests increase, the time to process the conversion starts increasing. For eg, at 100 tps, the time taken for process is 10 ms, but at 2000 tps, the time taken is 90ms. How can I avoid it? Is there a way to make it independent of tps.

Please provide the code you use, it is hard to optimize it otherwise.

There are other serialization options and JSON frameworks available. If you want to keep JSON, look for other frameworks like "json-smart": http://code.google.com/p/json-smart/ They claim to be 2-3 times faster than Jackson.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM