3 ms·
> memcpy() (ie "read()" in this case) is _always_ going to be faster in many > cases, just because it avoids all the extra complexity. While mmap() is > go
by pengaru 3y ago
> memcpy() (ie "read()" in this case) is _always_ going to be faster in many
> cases, just because it avoids all the extra complexity. While mmap() is
> going to be faster in other cases.
> - Linus Torvalds [0]
At least a long-running db process can amortize the page table costs across many operations, unlike something ephemeral like journalctl/systemctl where it really hurts.
[0] https://yarchive.net/comp/mmap.html https://yarchive.net/comp/mmap.html