How can I quickly enumerate directories on Win32?

前端 未结 6 1794
刺人心
刺人心 2020-12-04 22:30

I\'m trying to speedup directory enumeration in C++, where I\'m recursing into subdirectories. I currently have an app which spends 95% of it\'s time in FindFirst/FindNextFi

6条回答
  •  囚心锁ツ
    2020-12-04 23:06

    Don't recurse immediately, save a list of directories you find and dive into them when finished. You want to do linear access to each directory, to take advantage of locality of reference and any caching the OS is doing.

提交回复
热议问题