Is there a workaround for Java's poor performance on walking huge directories?

前端 未结 10 811
予麋鹿
予麋鹿 2020-12-02 23:30

I am trying to process files one at a time that are stored over a network. Reading the files is fast due to buffering is not the issue. The problem I have is just listing

10条回答
  •  醉话见心
    2020-12-03 00:15

    I doubt the problem is relate to the bug report you referenced. The issue there is "only" memory usage, but not necessarily speed. If you have enough memory the bug is not relevant for your problem.

    You should measure whether your problem is memory related or not. Turn on your Garbage Collector log and use for example gcviewer to analyze your memory usage.

    I suspect that it has to do with the SMB protocol causing the problem. You can try to write a test in another language and see if it's faster, or you can try to get the list of filenames through some other method, such as described here in another post.

提交回复
热议问题