Re: [twsocket] IndexOf is slow when there are thousands ofclientsconnected

2010-12-08 Thread Anton S.
>One OT question: Would it be faster if we use the cat() method of AnsiString >instead of the + operand? It would be faster for you to check it yourself. I have no idea with BCB but on Delphi + operator is counted to be faster than Append(). -- Anton -- To unsubscribe or change your settings for

Re: [twsocket] IndexOf is slow when there are thousands ofclientsconnected

2010-12-08 Thread Arno Garrels
Fastream Technologies wrote: > So you are right in your saying that when Sorted = true, Add()'s are > with binary search. But there is a HACK one needs to be very careful > about: If you do not set Duplicates = dupAccept, then it calls > IndexOf() before inserting to see if the same value exists!!

Re: [twsocket] IndexOf is slow when there are thousands ofclientsconnected

2010-12-07 Thread Fastream Technologies
Hello Arno, On Tue, Dec 7, 2010 at 7:48 PM, Arno Garrels wrote: > Fastream Technologies wrote: > > Hello, > > > > I have fixed the function as below (providing for the sake of > > completeness): > > You are re-inventing the wheel. Simply set property TStringList.Sorted to > True > and a Add() or

Re: [twsocket] IndexOf is slow when there are thousands ofclientsconnected

2010-12-07 Thread Arno Garrels
Fastream Technologies wrote: > Hello, > > I have fixed the function as below (providing for the sake of > completeness): You are re-inventing the wheel. Simply set property TStringList.Sorted to True and a Add() or AddObject() uses binary search to Insert data at the right index. As I mentioned