Why does Directory.GetFiles() run faster on subsequent runs?

后端 未结 1 553
死守一世寂寞
死守一世寂寞 2021-01-13 21:10

I\'m not really sure what causes this so please forgive me if I couldn\'t find the information I needed in a search. Here is an example:

Let\'s say that we have a fo

相关标签:
1条回答
  • 2021-01-13 21:40

    Hard drives have internal caches that will help speed up subsequent reads. Try reading a bunch of other directory information in a completely different sector to clear the cache.

    0 讨论(0)
提交回复
热议问题