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
AI-generated apps that pass security review Icon
AI-generated apps that pass security review

Stop waiting on engineering. Build production-ready internal tools with AI—on your company data, in your cloud.

Retool lets you generate dashboards, admin panels, and workflows directly on your data. Type something like “Build me a revenue dashboard on my Stripe data” and get a working app with security, permissions, and compliance built in from day one. Whether on our cloud or self-hosted, create the internal software your team needs without compromising enterprise standards or control.
Try Retool free
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