alecthomas / go_serialization_benchmarks

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

Buffer Reuse Inconsistency Again #129

Closed ymz-ncnk closed 8 months ago

ymz-ncnk commented 8 months ago

BENC reuses the buffer in its Pre benchmarks, but as I understand, it was decided not to allow this behavior (#107) @deneonet.

deneonet commented 8 months ago

Because it is reusing the buffer, it is used in a new benchmark, if it bothers you I can add a notice there.

ymz-ncnk commented 8 months ago

No, it doesn't bother me. I'm just reminding that earlier a decision was made to remove all such code from separate benchmarks. And now we will start adding them again... Do you understand what I mean?

ymz-ncnk commented 8 months ago

There was an open issue #106 and after it #107.

deneonet commented 8 months ago

Okay, my bad. I remove the benchmark.

deneonet commented 8 months ago

Heres the pull request: #131

alecthomas commented 8 months ago

I'm actually not against pre-allocating buffers, but if we were to allow it it would have to be very clear which benchmarks were pre-allocated and which weren't.

Basically, I don't have an issue with any particular optimisations as long as it's very clear what they are and what the tradeoffs are.