3 ms·
> Here, they seem to acknowledge that it can be faster to make a single call. It calls the internal Fill function to fill 4 bytes of the slice at a time. That
by timewizard 1y ago
> Here, they seem to acknowledge that it can be faster to make a single call.
It calls the internal Fill function to fill 4 bytes of the slice at a time. That calls the rng assembly stub function which uses 'rdrand' to get 32bits of random data. Which gets called len(b)/4 times.
I don't think they did it for speed but rather to be more idiomatic.
Anyways, OSDev has had a "Go Bare Bones" page for quite a while:
https://wiki.osdev.org/Go_Bare_Bones https://wiki.osdev.org/Go_Bare_Bones