Quicker (quickest?) way to get number of files in a directory with over 200,000 files

前端 未结 10 1424
Happy的楠姐
Happy的楠姐 2021-02-04 07:35

I have some directories containing test data, typically over 200,000 small (~4k) files per directory.

I am using the following C# code to get the number of files in a di

10条回答
  •  一向
    一向 (楼主)
    2021-02-04 07:52

    Create an index every day at midnight. Finding a file will go very fast then. And counting the number of files is just as trivial.

    If I see it right, you have one dir for each day. If all files you receive today go in the map of today then this system can be improved. Just index the directory of the previous day at midnight.

提交回复
热议问题