alecthomas / go_serialization_benchmarks

Benchmarks of Go serialization methods
https://alecthomas.github.io/go_serialization_benchmarks/
1.56k stars 158 forks source link

Remove allocation from unmarshal benchmark #134

Closed matheusd closed 4 months ago

matheusd commented 4 months ago

This removes one allocation from all benchmarks that are run with the standard benchUnmarshal() function.

The allocation was for the target of the unmarshal. This is replaced with a single object used throughout the test and cleared before each test iteration.