IdFtpServer - poor performance of a listing directory

Giganews Newsgroups
Subject: IdFtpServer - poor performance of a listing directory
Posted by:  Tomasz B (t.berg.REMO…@slican.pl)
Date: Tue, 09 Sep 2008

Hello

I've again a little problem with IdFTPServer - it looks like it generate
directory listing very slow.

Does anybody know how to speed up this process?

Environment:
BCB6, indy 10 VCL, svn revision 3252

Details:

I'm serving IdFTPServer::OnListDirectory very fast (in time less than 1
second) - adding about 400 files into a TIdFTPListOutputItem list (on
averege each file name contains 100 characters). After that iFTPserver
utilizes 100% CPU (on quad core CPU wtf?) and as I imagine is trying  to
send generated listing into client.

But client has already disconnect from server (it ugly propery of ftp
client from total commander).

I can understand than ftp client should have bigger time out value but
linux (vsFTPd 2.0.5) run on PPC (25 MHz) has enough 'power' to send
directory listening which contains more than 2000 files and can do it
before totalcmd disconnect.

Below I pasted a call stack of a thread which I believe is eating my CPU:

02EA35EE Idglobal::CharPosInSet
02EA3628 Idglobal::CharIsInSet
02E90074 IdFTPListOutput::_16410
02E92BD9 IdFTPListOutput::_16450
02E91754 Idftplistoutput::TIdFTPListOutput::LISTOutputDir
02E87075 Idftpserver::TIdFTPServer::CommandLIST
02EB48F9 Idcommandhandlers::TIdCommand::DoCommand
02EB4610 Idcommandhandlers::TIdCommandHandler::Check
02EB417B Idcommandhandlers::TIdCommandHandlers::HandleCommand
02EB4E30 Idcmdtcpserver::TIdCmdTCPServer::DoExecute
02EB3B7A Idcontext::TIdContext::Run
400375AF C:\Windows\SysWOW64\rtl60.bpl
400067CE C:\Windows\SysWOW64\rtl60.bpl
76CCE3F3 C:\Windows\syswow64\kernel32.dll
775CCFED ntdll.dll
775CD1FF ntdll.dll

--
Best regards
Tomasz Berg

Replies