Re: [twsocket] IndexOf is slow when there are thousandsofclientsconnected

2010-12-08 Thread Fastream Technologies
We already have to check the presence of the string/object in cache so avoiding AddObject() also eliminates the Find(). Regards, SZ On Wed, Dec 8, 2010 at 10:46 AM, Arno Garrels wrote: > Fastream Technologies wrote: > > Hello Arno, > > > > On Tue, Dec 7, 2010 at 7:48 PM, Arno Garrels > > wrot

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 thousandsofclientsconnected

2010-12-08 Thread Arno Garrels
Fastream Technologies wrote: > 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

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!!