Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid the allocation of converting the byte slice or buffer contents to a string with an unsafe cast. This should be safe because the CheckedEntry is invalidated once ce.Write is called, so it's not expected to use the associated string again. ``` name old time/op new time/op delta Writer/single-4 422ns ±21% 329ns ± 2% -21.99% (p=0.000 n=10+10) Writer/splits-4 433ns ± 4% 384ns ± 5% -11.26% (p=0.000 n=9+9) name old alloc/op new alloc/op delta Writer/single-4 16.0B ± 0% 0.0B -100.00% (p=0.000 n=10+10) Writer/splits-4 16.0B ± 0% 0.0B -100.00% (p=0.000 n=10+10) name old allocs/op new allocs/op delta Writer/single-4 2.00 ± 0% 0.00 -100.00% (p=0.000 n=10+10) Writer/splits-4 2.00 ± 0% 0.00 -100.00% (p=0.000 n=10+10) ```
- Loading branch information