2 ms·
> easy way to fool yourself when you are measuring performance In this case isn't the "already in RAM" test a more accurate reflection of performance anyway, a
by dspillett 8y ago
> easy way to fool yourself when you are measuring performance
In this case isn't the "already in RAM" test a more accurate reflection of performance anyway, as we are talking about the performance of grep and not the IO subsystem?
There are many cases where grep's performance won't be bottlenecked by IO, or at least not impacted directly by a bottleneck there. Anywhere when the input is coming from another program, essentially, and even if that task is IO bound it might be sending output to grep much faster than it is consuming input (perhaps gunzip <file | grep searchtext).
And in the case of searching a log file interactively, it is common that you won't just run grep of the file just once in a short space of time, instead doing it a couple of times as you refine your search, so for most of the runs it will be in cache (assuming the file is not to large).
- Rapzid 8y agoThe data could also be in the VFS cache/buffers for a number of reasons depending on the system setup and access pattern; including being written.