Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact

FTPClient Performance

Moderators: kris

Posted: 11/28/07 20:29:07

I've played around with the FTPClient/FTPConnection and noticed it's really slow. I compared a simple application(connect, upload a file and then close) that uses the FTPConnection class to some other FTP clients. I compared the time it took to upload a file at around 240MB to a FTP server at the local network using a simple stopwatch. With FileZilla? it took 20 seconds, with UltraFXP 25 seconds and with the simple application that uses the FTPConnection 90-100 seconds. That's up to 5 times slower than the other FTP clients.

Author Message

Posted: 11/29/07 03:41:29

Any ideas why that might be?

Posted: 11/29/07 22:56:37

I don't know, but what I do know is that it's somewhere in the FTPConnection.sendStream method or in some underlying socket or stream classes/functions. I can try to see if I can find something if I have time.

Posted: 11/30/07 00:59:51

that would be great! It may be that the output buffer size is not ideal, or may simply be that Ftp.sendStream() is just inefficient ...

Posted: 12/02/07 22:51:21

I've done some more testing. Transferring a file of the size 350MB to a server on the local network takes for UltraFXP 33.45 seconds. I've increased the buffer size from 8*1024 to 1010*1024(any larger I get stack overflow) and then FTPConnection transfered the same file in 33.17226 seconds. I don't know if it's good to increase the buffer that much but it helped. I haven't looked for any other ways to optimize the FTPConnection yet.