3 ms·
Methodologically it makes sense to exclude work done in the mmap call. After all you would do that once to initialize the memory but you never need to call it t
by jschwartzi 6y ago
Methodologically it makes sense to exclude work done in the mmap call. After all you would do that once to initialize the memory but you never need to call it to do the work. The point of the test wasn't to check performance of the mmap syscall versus the read syscall, but simply to check the performance of read() versus memory-mapped files.
- scottlamb 6y agoTo check the performance of read() versus memory-mapped files with a cold cache, you should absolutely be including the actual IO. But on my closer read, they did that earlier in the article. Here they are examining the (userspace) memcpy in isolation. MAP_POPULATE is just a tool to help with that. They could get a similar effect by just looking at the second (on to Nth) call to do_mmap_test, not the first. Or just copying from heap memory to heap memory, without involving any kernel stuff at all...