4 ms·
nice! btw, wrt the `Memset` function, if you have something like func foo(b []byte) { for i := range b { b[i] = 0 } } the
by barsonme 9y ago
nice! btw, wrt the `Memset` function, if you have something like
func foo(b []byte) {
for i := range b {
b[i] = 0
}
}
the compiler turns it into a `memclr` call which can be pretty fast: https://github.com/golang/go/commit/f03c9202c43e0abb130669852082117ca50aa9b1 https://github.com/golang/go/commit/f03c9202c43e0abb13066985...
Perhaps there could be a performance boost to a simple for-range loop if `value == 0`?