3 ms·
> lseek+read is two system calls You'd never do that, though -- you'd use pread.
by loeg 1y ago
> lseek+read is two system calls
You'd never do that, though -- you'd use pread.
- kragen 1y agoThe article I'm commenting on said its author used seek and read, so I don't know if maybe for some reason they did do that instead of pread(), which it also mentioned. I didn't want to optimistically assume otherwise. Is pread() available in the Golang standard library? https://github.com/golang/go/issues/19563 https://github.com/golang/go/issues/19563 is someone using os.File.ReadAt, which is a method name that makes me even more uncertain. But there's also syscall.Pread apparently, so it should be fine? If you are making only one system call, the 25× crossover point is 800-some bytes by my measurements.