4 ms·
Gee, for a fast memory move of blocks of data that contained some whole virtual memory pages the fast way was just to have an API to the OS that tweaked the vi
by graycat 10y ago
Gee, for a fast memory move of
blocks of data that contained
some whole virtual memory pages
the fast way was just to
have an API to the OS that
tweaked the virtual memory
page-segment tables! I'm not
sure that simple idea has
ever been used -- maybe there
are some problems with it.
- mikeash 10y agoI recall that macOS's memcpy does this for some cases. There's overhead for the syscalls and TLB invalidation, so it's not efficient for smaller copies, but it's a win for bigger ones. I think it considers the breakeven point to be 40kB. And of course the source and destination both must be page-aligned.
- wmf 10y agoThat idea has definitely been used for IPC (instead of copying data you can just "donate" pages to the receiving process), but it's often slower due to TLB invalidation. Sadly, real-world performance is much harder than "zero copy = faster".