Hello,

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 huge CPU hog when there are 30k clients!

In some other parts of our code we wrote we overcome this issue by using a
sorted TStringList holding the pointers normally held in
FClientList->Items[] in stringList->Objects[] and converting the memory
address to first integer and then String and assigning it to the
stringList->Strings[] (with the same index of course).

Then we use a binary search function to search among the Strings[] to find
the index and delete without IndexOf. It works perfectly!

Regards,

SZ

On Mon, Dec 6, 2010 at 5:21 PM, Anton S. <an...@rambler.ru> wrote:

> The thing that ICS would sometimes become multi-platform is great! I myself
> have quite little knowledge of what things are on *nix but I found an
> article that seems like a good start. It describes several approaches to
> doing async on *nix. I think it would be easier to use one of these and keep
> ICS's async ideology.
>
> Here it is: http://www.kegel.com/c10k.html
>
> --
> Anton
> --
> To unsubscribe or change your settings for TWSocket mailing list
> please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
> Visit our website at http://www.overbyte.be
>
--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

Reply via email to