Release notes — v2.33.1
Highlights
- Restore pre-v2.33.0 decode allocation profile — fixes a regression where every Avro
stringandbytesfield 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.ReadBytesandReader.ReadStringnow thread the error function name through as a string literal instead of computing it insidereadBytes. The previous code ranfnName := "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
stringspackage is no longer imported byreader.go.
Full changelog: git log v2.33.0..v2.33.1