Skip to content

Releases: ugorji/go

1.2.12

30 Nov 09:30
Compare
Choose a tag to compare

Release 1.2.12

This is a production release of go-codec.

Changes include:

  • expose (En|De)coder.HandleName()
  • cbor: fix indefinite stream conformance
  • codecgen: use base32 to generate field names
  • return io.ErrUnexpectedEOF (not io.EOF) when EOF is reached while needing more data

Please try it out and share your experiences.

1.2.11

08 Mar 16:29
Compare
Choose a tag to compare

Release 1.2.11

This is a production release of go-codec.

Changes include:

  • codecgen: fix decoding missing fields of struct from array, due to double counter increment

Please try it out and share your experiences.

1.2.10

20 Feb 16:29
Compare
Choose a tag to compare

Release 1.2.10

This is a production release of go-codec.

Changes include:

  • codecgen: fix error decoding struct from array, due to misplaced counter increment
  • fix error encoding interface{} map key in Canonical mode

Please try it out and share your experiences.

1.2.9

03 Feb 17:44
Compare
Choose a tag to compare

This is a production release of go-codec.

Changes include:

  • faster growslice (as zero'ing memory only done if needed)
  • make decoding via io.Reader more robust
  • read and write optimizations
  • clean up code across the board
  • benchmark decoding for different engines against same set of encoded bytes
  • improve inline'ability of code across runtime and codecgen'erated codebases

Please try it out and share your experiences.

1.2.8

27 Dec 11:41
Compare
Choose a tag to compare

This is a production release of go-codec.

Changes include:

  • treat an array with all zero values as empty, and omit if omitempty=true
  • module support: ensure module dependencies are auto-generated by go tool
  • support go 1.20: needed fix for growslice in unsafe mode
  • add support for go 1.13 error wrapping
  • codecgen: optimize canonical encoding, handling extensions, named types and ordered keys
  • codecgen: handle canonical encoding of map and struct well
  • codecgen: skip type aliases
  • codecgen: fix spurious errors in generated code calling codec.Selfer encode methods

Please try it out and share your experiences.

1.2.7

26 Feb 19:54
Compare
Choose a tag to compare

This is a production release of go-codec.

Changes include:

  • support registering extension functions for time.Time
  • fix bugs with encoding/decoding very-nested slices in specific cases

Please try it out and share your experiences.

1.2.6

15 May 01:29
Compare
Choose a tag to compare

This is a production release of go-codec.

Changes include:

  • support EncodeOptions.NoAddressableReadonly option
  • streamline/reduce size of helper types
  • optimize side(En|De)code and (En|De)codeExt calls
  • decode a number from any number in the stream i.e.
    you can decode a float/integer/unsigned integer from any number in stream
  • clean up tests so they work completely regardless if we recover from panics
  • improve inlining of common functions

Please try it out and share your experiences.

1.2.5

30 Mar 17:41
Compare
Choose a tag to compare

This is a production release of go-codec.

This is a very important release, building upon the optimization introduced in v1.2.4.

Changes include:

  • support gollvm in addition to gccgo in default high-performance mode
  • support codec.safe and codec.notfastpath as preferred build tags (replacing safe and notfastpath)
  • support Canonical mode with MissingFielder
  • robust handling of codecgen caveats wrt Canonical|CheckCircularRef flags and MissingFielder implementations
  • robust handling of transient values, where we track if a value has internal pointers and handle appropriately
  • reduce use of global values: all in-use values are scoped to an Encoder or Decoder
  • implement stateManager for Encoder/Decoder, supporting capture, reset and restore functions.
  • side encoding or decoding can now reuse an Encoder/Decoder, leveraging state management to
    capture its state, do something else, then restore its state and continue
  • support running all tests in parallel, so we can shake out any concurrency issues
  • Fix issue in rpc where writer was not being flushed, causing a hang where reader was
    waiting on an encoded value
  • Support shallow copies of a Handle, to support parallel execution where we need to
    temporarily change some Handler fields

This is the best release yet. Please try it out and share your experiences.

1.2.4

04 Feb 17:27
Compare
Choose a tag to compare

Release 1.2.4

This is a production release of go-codec.

This is a very important release, which focused on optimization across the board to
ensure that go-codec is the most performant library for popular encoding formats.

Optimizations across the board include:

  • optimization by eliding allocation where not necessary e.g.
    • when encoding non-addressable value with ptr receiver
    • map iteration/access
    • decoding floats
    • creating slices or sub-slices (removing temporary slice allocated on heap)
    • decoding map keys if both key and value kinds are scalars
    • decoding map values if value kind is a scalar
  • better reuse of pool'ed []byte(s)
  • leveraging mapXXX_fastXXX calls where possible
  • better inlining (where applicable) e.g. arrayStart, mapStart, etc
  • support complex numbers (where we treat complex numbers as floats with imaginary part = 0)
  • optimize encoding and decoding arrays, including using fast-paths for slices as applicable
  • use runtime's growslice algorithm when growing arrays for better performance
  • optimize nextValueBytes and swallow so they do not allocate when applicable e.g.
    do not allocate/copy bytes if swallow is called or you were decoding from a []byte (just return a sub-slice)
  • optimize isEmptyStruct to just compare if value == zero'es (instead of field by field),
    simulating comparing to zero value.

To guarantee better fairness in benchmarking, we did the following:

  • use common types in benchmarks and common methods to ensure fairness in benchmarks
  • run benchmarks with ZeroCopy=true and (MapValue|Interface|SliceElement)Reset = true,
    aligning with how other libraries operate by default

With these changes, we have reflection-based mode performing within 25% of codecgen,
with similar allocation numbers as codecgen. For example, encoding typically has just 1
allocation without codecgen (just as in codecgen).

This is the best release yet. Please try it out and share your experiences.

1.2.3

10 Jan 04:56
Compare
Choose a tag to compare

This is a production release of go-codec.

This optimizes decoding for zero-copy mode when decoding from a string or []byte.

With this mode, we see 50% reduction in allocation in both codecgen and normal execution,
and this gives performance better than other libraries (easyjson, json-iterator, etc)
while providing much more features and supported formats (json, cbor, msgpack, simple, etc).