Golang Marshal & Unmarshal Benchmark

Hursit Topal
Wingie / Enuygun Tech
2 min readApr 15, 2024

Golang is known for its performance and efficiency. JSON operations are among the most common operations, and therefore, the speed of JSON encoding (marshal) and decoding (unmarshal) operations is crucial. In this article, we’ll examine a benchmark study comparing the performance of various JSON processing libraries.

Benchmark Results

Marshal

Unmarshal

Marshal + Unmarshal

Results and Analysis

  • Despite being the standard library, encoding/json sometimes exhibits slower performance compared to other libraries.
  • jsoniter provides flexibility with different configurations (Default, Fastest, Standard) and generally offers faster performance than encoding/json.
  • The go-json library generally shows acceptable performance

These results provide insights into the speed of JSON encode and decode operations, which can significantly impact application performance. However, it’s important to note that performance may vary depending on real-world scenarios with different data sizes and structures.

For more information on each library:

Github repository: https://github.com/WEG-Technology/go-marsh-bench

If you want to join our team, share your CV with us: kariyer@enuygun.com

--

--