开发者

What determines cache speed?

I have a progra开发者_如何学Pythonm that reads from a file and performs operations on it (count frequencies of words)....I have 4 different file sizes, i get cache speed on all but the largest. Why does the largest file only run at disk speed no matter how many times i run it? Does too much ram usage restrict the cache from running? The large file is 27 gb. Running on windows. This is file caching, not CPU caching


Cache == memory. Run out of memory, you run out of cache. If you have a file that is greater than the size of the cache, and you're streaming through it, it's as if you had pretty much no cache at all. Cache only helps when you read the data again, it has no effect on the first time.

When the file is greater than the memory, then there is never any of the original file left in memory when you try to re-use it, thus the cache has pretty much no value in that case. The other dark side is that when you do that, you may well lose the cache on all of the other small files that the system accesses often and are no longer cached. So it may take a bit longer for things to reload and get back up to speed.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜