Closed mareklabonarski closed 8 years ago
Would you might submitting a Pull Request for that?
See also #68 which unfortunately petered out before any conclusion was reached :-/
There will be a good solution to this in fs2.0. The api design in the current version makes it tricky list directories optimally...
Hi,
I recently used fs to deal with ftp. Code is very nice and clean, but looks like there is a wrong concept to get directory info, which makes it far far more slower than it could be. First, from what I see, directory list is taken with all the stats together, than the stats are wiped of, and then taken again for each of the directories separately. With directory set 1000+, instead of few commands, there are 1000+ commands sent to ftp which makes a huge overhead. Methods pasted below should show it:
I have modified (created new) listdirinfo for my needs. It looks as below:
def fast_list_dir_info(self, *args...) path = normpath(path) if not ftp.exists(path): raise ResourceNotFoundError(path) if not ftp.isdir(path): raise ResourceInvalidError(path) return ftp._readdir(path)
:)
Would you consider fixing the performance issue in your code?
Best Regards, Marek