Is FastJson Really Faster? A Practical Comparison with Jackson and Gson
This article examines Alibaba's FastJson library, benchmarks its serialization speed against Jackson and Gson, discusses its popularity and issue count on Maven, and concludes with recommendations for JSON parsing choices in Java projects.
1. What Is FastJson?
FastJson is an open‑source JSON parsing library from Alibaba that can convert JSON strings to Java objects and serialize Java beans to JSON. It is widely used by Java developers because of its claimed speed.
2. Is It Really Faster?
To verify the speed claim, a simple benchmark was performed comparing FastJson with the more popular Jackson and Google’s Gson. The test ran on JDK 8, an AMD 3700X CPU, and 3200 MHz memory, converting both simple and complex objects to and from strings ten million times. The results (in milliseconds) show that FastJson is indeed the fastest, but only about 20% faster than Jackson, while Gson is considerably slower.
The benchmark does not cover memory usage or large‑document handling, and in most modern applications even the slowest library (Gson) meets performance requirements. Factors such as I/O optimization and parallel processing often have a greater impact than the choice of JSON library.
3. How Popular Is FastJson?
FastJson’s Maven Central usage is far lower than that of Jackson, and it has a large number of unresolved issues (over 1,200). Community feedback on platforms like Zhihu points out concerns about code quality and maintenance.
Issue tracking shows many open bugs, and some reported problems involve incorrect date parsing and other logic errors.
4. Should You Keep Using FastJson?
In projects that already use Jackson (especially with Spring Boot), it is advisable to stick with Jackson to minimize dependencies. While FastJson can be faster in isolated benchmarks, its lower popularity, higher issue count, and limited community support make Jackson a more reliable choice for most applications.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Java Backend Technology
Focus on Java-related technologies: SSM, Spring ecosystem, microservices, MySQL, MyCat, clustering, distributed systems, middleware, Linux, networking, multithreading. Occasionally cover DevOps tools like Jenkins, Nexus, Docker, and ELK. Also share technical insights from time to time, committed to Java full-stack development!
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
