Y
Hacker News
new
|
ask
|
show
|
jobs
by
do_not_redeem
232 days ago
Even if the file is cached, fread has to do a memcpy. mmap doesn't.
1 comments
gpderetta
232 days ago
fread is (usually) buffered io, so it actually does two additional mem copies (kernel to FILE buffer then to user buffer)
link
assbuttbuttass
232 days ago
Not in Go
link
gpderetta
232 days ago
oh, right, this is Go (
https://pkg.go.dev/github.com/odeke-em/go-utils/fread#sectio...
). Do the strings it return share memory with the internal buffer?
link