5 ms·
> It's hard to believe this would give a significant performance boost. Why is that so hard to believe? It's a standard optimization—the kernel can almost cert
by duaneb 13y ago
> It's hard to believe this would give a significant performance boost.
Why is that so hard to believe? It's a standard optimization—the kernel can almost certainly coordinate reading better than your userspace C can.
- sillysaurus3 13y agoSo are we talking about constant-time optimization, then? I.e. it shaves off a few milliseconds regardless of how complex the search is, or how many files it's reading, or how large each file is. I'll happily concede that mmap() might do that. But a performance boost linear w.r.t. search complexity/number of files/filesize? Hard to believe, and I should go measure it myself to prove the point or learn why I'm mistaken.
- Crito 13y agoLikely a constant time improvement... for each file being searched. I don't think that anybody is claiming that mmapping actually changes the algorithmic complexity of the actual search operations.
- duaneb 13y agoConstant-time improvements are still improvements, especially if they're in an inner loop. Otherwise we would all be using Python and just writing great algorithms.