1

I became curious when I was diffing two large (>326MB) files, and noticed that the second run took much less time than the first. This was frustrating, since I was trying to time the second run, to see how long the diff took. :)

The man page doesn't mention a cache, and searching for 'diff cache' seems to flood me with results for the git diff subcommand, which is not what I'm interested in learning about. So, my question is:

Why did the second run of diff largeFile1 largeFile2 take so much less time than the first? Where can I find more information?

1 Answers1

3

diff isn't doing any caching. The OS is. If you are using Linux, you can flush the disk buffers and cache. See How do you empty the buffers and cache on a Linux system?

Otheus
  • 6,138
  • Ah, I see. I guess I shouldn't have given up after not finding a 'diff' directory under /var/cache. I'll try to use that link to find more info. 'preciated. – Jon Carter Mar 03 '16 at 17:09