Slow ListDirectory Method

Advertisement

bobmcrae
Joined:
Posts:
5
Location:
United States

Slow ListDirectory Method

I am currently using the .NET COM assembly and the ListDirectory method, recursively. I am finding that its performance is pretty slow (in directories with NO symbolic links). I am wondering whether the command line scripting approach could offer faster performance in a recursive directory listing. The one issue I am not sure how to address is that I cannot perform (or don't know how) the recursion within a WinSCP script. Therefore, it would seem I would need to create a new session for each directory recursion, which defeats the performance objectives.

Any ideas?

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,454
Location:
Prague, Czechia

Re: Slow ListDirectory Method

You can do the recursions over a single session using techniques described in this article:
https://winscp.net/eng/docs/guide_interpreting_xml_log

But you will end up doing what the .NET assembly does for you. So it's pointless.

Please attach a full debug log file showing the performance problem (using the latest version of WinSCP).

To generate log file, set Session.DebugLogPath. Submit the log with your post as an attachment. If you do not want to post the log publicly, you can mark the attachment as private.

Reply with quote

bobmcrae
Joined:
Posts:
5
Location:
United States

Re: Slow ListDirectory Method

Thanks for the fast response and thoughtfulness Martin. I have tried another client that offers recursion (lftp on a linux box) and see the same issue. It seems that changing directories comprises the main performance hit. So, I suspect that even using scripting would result in the same issue. In my case, I often have just 1-2 files per directory, so I have to traverse each one looking for new files. Even a mask would not work, because the timestamp on the directory remains unchanged, when a new file is deposited or changed.

I am particularly impressed with Windows tree command and its speed, even traversing directories. If I had more access to the FTP server's OS, I might be able to do a tree, but I don't.

I think what I might need to do -- if faster performance is necessary -- is to run a nightly batch and create a tree file for each account.

Thanks again, for your response and your excellent work on WinSCP.

Reply with quote

Advertisement

You can post new topics in this forum