Re: [twsocket] IndexOf is slow when there are thousands of clients connected

2010-12-07 Thread Angus Robertson - Magenta Systems Ltd
> >clientString := IntToStr(ULong(Client)) > Won't it be much faster to use TList with custom Compare method > which would compare Client pointers as integers? String comparison > is a waste. Exactly, strings are totally unnecessary, ICS already uses sorted TLists in OverbyteIcsFtpSrvT for direc

Re: [twsocket] IndexOf is slow when there are thousands of clients connected

2010-12-07 Thread Fastream Technologies
For this very particular FClientList, you are right. But for example we use the same function for RAMCacheFile and DISKCacheFile witht the URI in String and the object in the Object. So we needed this function anyway and just tested to use it for this purpose as well... Regards, SZ On Tue, Dec 7

Re: [twsocket] IndexOf is slow when there are thousands of clients connected

2010-12-07 Thread Arno Garrels
Anton S. wrote: > Fastream Technologies wrote: >> clientString := IntToStr(ULong(Client)) > Won't it be much faster to use TList with custom Compare method which > would compare Client pointers as integers? String comparison is a > waste. That's the next point ;) See my test it uses a sorted TObje

Re: [twsocket] IndexOf is slow when there are thousands of clients connected

2010-12-07 Thread Anton S.
Fastream Technologies wrote: >clientString := IntToStr(ULong(Client)) Won't it be much faster to use TList with custom Compare method which would compare Client pointers as integers? String comparison is a waste. -- Anton -- To unsubscribe or change your settings for TWSocket mailing list please

[twsocket] IndexOf is slow when there are thousands of clients connected

2010-12-07 Thread Anton S.
I dared to start the discussion in a separate thread. >I have seen a bottleneck in ICS with tens of thousands of clients: When a >client is disconnected the TWSocketServer calls FClientList->IndexOf() for >finding the index to remove the object! IndexOf is simply exhaustive search >and it is a hug