Optimizing JSON Parsing in Java
Optimizing JSON Parsing in Java

Optimizing JSON Parsing in Java

Author
Shiv Bade
Tags
json
jackson
performance
Published
March 18, 2018
Featured
Slug
Tweet
We had an API that slowed under large JSON payloads. After profiling, it turned out the bottleneck was in Jackson parsing.
Tweaks that helped: - Used @JsonProperty annotations to reduce reflection - Disabled FAIL_ON_UNKNOWN_PROPERTIES - Enabled stream-based parsing where applicable
Bonus: We benchmarked Jackson vs Gson vs Moshi. Jackson won for speed, but Moshi impressed with predictability.
Java may not be a “fast” language for JSON, but with the right config, you can squeeze out solid performance.