GoJay is a performant JSON encoder/decoder for Golang (currently the most performant, see benchmarks). It has a simple API and doesn't use reflection. It relies on small interfaces to decode/encode structures and slices. Gojay also comes with powerful stream decoding features and an even faster Unsafe API. There is also a code generation tool to make usage easier and faster. I looked at other fast decoders/encoders and realized it was mostly hardly readable static code generation or a lot of reflection had poor streaming features and were not so fast in the end. Also, I wanted to build a decoder that could consume an io.Reader of line or comma delimited JSON, in a JIT way. To consume a flow of JSON objects from a TCP connection for example or from a standard output. The same way I wanted to build an encoder that could encode a flow of data to a io.Writer.

Features

  • Decoding is done through two different API similar to standard encoding/json
  • Unmarshal API decodes a []byte to a given pointer with a single function
  • Decode API decodes a []byte to a given pointer by creating or borrowing a *gojay.Decoder with an io.Reader and calling Decode methods
  • All DecodeXxx methods are used to decode top level JSON values
  • NKeys method must return the number of keys to Unmarshal in the JSON object or 0. If zero is returned, all keys will be parsed
  • Encoding is done through two different API similar to standard encoding/json

Project Samples

Project Activity

See All Activity >

Categories

Frameworks

License

MIT License

Follow GoJay

GoJay Web Site

Other Useful Business Software
Our Free Plans just got better! | Auth0 Icon
Our Free Plans just got better! | Auth0

With up to 25k MAUs and unlimited Okta connections, our Free Plan lets you focus on what you do best—building great apps.

You asked, we delivered! Auth0 is excited to expand our Free and Paid plans to include more options so you can focus on building, deploying, and scaling applications without having to worry about your security. Auth0 now, thank yourself later.
Try free now
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of GoJay!

Additional Project Details

Operating Systems

Linux, Mac, Windows

Programming Language

Go

Related Categories

Go Frameworks

Registered

2023-01-24