Add import "github.com/json-iterator/go" and replace json.Marshal with jsoniter.Marshal. Then the code should behave exactly the same, just much faster. Unlike easyjson or other json libaries, jsoniter does not rely on static code generation. Unmarshal, NewEncoder, NewDecoder they all works. Existing types implemented Marshaler or Unmarshaler interface will also work. Map with non-string key also work. Yes, everything just works. The default performance is already several times faster than the standard library. Use jsoniter.ConfigFastest, this will marshal the float with 6 digits precision (lossy), which is significantly faster.

Features

  • One line style
  • You can parse json in one line, without defining any struct
  • 100% Compatibility
  • By default, jsoniter do not sort the map keys like standard libary
  • The default performance is already several times faster than the standard library
  • Drop-in replacement

Project Samples

Project Activity

See All Activity >

Categories

Frameworks

License

MIT License

Follow json iterator

json iterator Web Site

nel_h2
MongoDB Atlas runs apps anywhere Icon
MongoDB Atlas runs apps anywhere

Deploy in 115+ regions with the modern database for every enterprise.

MongoDB Atlas gives you the freedom to build and run modern applications anywhere—across AWS, Azure, and Google Cloud. With global availability in over 115 regions, Atlas lets you deploy close to your users, meet compliance needs, and scale with confidence across any geography.
Start Free
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of json iterator!

Additional Project Details

Operating Systems

Linux, Mac, Windows

Programming Language

Go

Related Categories

Go Frameworks

Registered

2023-01-05