Hacker News new | ask | show | jobs
by PaulDavisThe1st 64 days ago
> The kernel can map that data in dynamically much faster than a userland process can.

Not necessarily. The kernel's mmap implementation has quite a strong bias towards certains kinds of access patterns; deviate from them and it can become slower than read(2).

We tried using mmap(2) for audio file i/o in Ardour, and it got notably less bandwidth than just using read(2).

1 comments

I'm curious if you tried different madvise strategies and if any of them worked better than others?
I don't recall - it was several years ago. But glancing through what is left of the test program, it seems likely that we did not.