FastJson: Speed Claims, Popularity, and Why It Should Be Abandoned
The article examines Alibaba's FastJson library, presenting performance tests against Jackson and Gson, revealing modest speed gains, low adoption in Maven, numerous unresolved issues, and ultimately recommending developers switch to Jackson for JSON processing in Java projects.
FastJson is an open‑source JSON parsing library from Alibaba that can serialize Java beans to JSON strings and deserialize JSON back to Java objects.
The author conducts a simple benchmark comparing FastJson with the widely used Jackson and Google Gson libraries on a JDK 8 environment (AMD 3700X, 3200 MHz RAM), measuring serialization and deserialization of simple and complex objects over ten million iterations.
The results show FastJson is indeed the fastest, but only about 20% faster than Jackson, while Gson is considerably slower; however, speed alone is not a decisive factor for library selection.
Popularity analysis reveals FastJson’s Maven dependency count is far lower than Jackson’s and Gson’s, and a quick look at its GitHub issues shows over 1,200 unresolved problems, indicating lower community confidence.
Several code snippets (shown as images) illustrate logical errors in FastJson’s handling of date‑time formats, causing conversion failures for correctly formatted strings while accepting malformed ones.
Based on the benchmark, popularity data, and quality concerns, the author advises abandoning FastJson in favor of Jackson, which enjoys broader adoption, better maintenance, and fewer bugs.
Top Architect
Top Architect focuses on sharing practical architecture knowledge, covering enterprise, system, website, large‑scale distributed, and high‑availability architectures, plus architecture adjustments using internet technologies. We welcome idea‑driven, sharing‑oriented architects to exchange and learn together.
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.