github iskorotkov/avro v2.33.1

3 hours ago

Release notes — v2.33.1

Highlights

  • Restore pre-v2.33.0 decode allocation profile — fixes a regression where every Avro string and bytes field decode allocated two extra strings via "Read" + strings.ToTitle(op). String- and bytes-heavy schemas regressed substantially in v2.33.0; this release returns them to v2.32.0 levels with no API or wire-format change.

Performance

  • perf(reader): pass fnName as constant to readBytes (reader.go) — Reader.ReadBytes and Reader.ReadString now thread the error function name through as a string literal instead of computing it inside readBytes. The previous code ran fnName := "Read" + strings.ToTitle(op) on every call: strings.ToTitle("string") allocated "String" and the "Read" + ... concatenation allocated "ReadString", neither folded by the compiler. The error-path concatenations ("invalid "+op+" length", op+" length is too big") stay where they were — they only run on error and aren't on the hot path.

    Apple M4 Pro:

    • BenchmarkSuperheroDecode — 0 allocs/op restored.
    • BenchmarkArrayDecode_String/n=1000 — 27 allocs/op (down from the v2.33.0 figure that scaled with element count).

    Wire format unchanged.

Notes for users

  • Pure perf patch. No public API changes, no behavioural changes on the error path. Drop-in upgrade from v2.33.0; recommended for anyone decoding string/bytes-heavy schemas.
  • The strings package is no longer imported by reader.go.

Full changelog: git log v2.33.0..v2.33.1

Don't miss a new avro release

NewReleases is sending notifications on new releases.