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
Get Avast Free Antivirus | Your top-rated shield against malware and online scams Icon
Get Avast Free Antivirus | Your top-rated shield against malware and online scams

Boost your PC's defense against cyberthreats and web-based scams.

Our antivirus software scans for security and performance issues and helps you to fix them instantly. It also protects you in real time by analyzing unknown files before they reach your desktop PC or laptop — all for free.
Free Download
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