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!!
That must have been the reason our c
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
Anton S. wrote:
> Arno wrote:
>> I don't think so, why should it?
>
> Well, the connection to HTTP client is closed when response is sent
That depends on whether the client uses HTTP 1.0 or HTTP 1.1 and whether
or not the Keep-Alive header is sent.
> (usually; there are some options in the requ
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
> >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
Hello,
I have fixed the function as below (providing for the sake of completeness):
function seekIndexToInsertForSortedStringList(stringList: TStringList;
stringToAdd: String; caseinsensitive: boolean) : Integer;
var
low, mid, high: integer;
begin
if(stringList.Count = 0) then
begin
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
Arno wrote:
>I don't think so, why should it?
Well, the connection to HTTP client is closed when response is sent (usually;
there are some options in the request header to keep it but these cases are
rarer).
I'm just supposing, not asserting.
--
Anton
--
To unsubscribe or change your settings
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
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
Anton S. wrote:
> 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 exhau
Arno Garrels wrote:
> Fastream Technologies wrote:
>> As far as I know, the TStringList->AddObject() method uses binary
>> search for finding the correct index to insert when
>> TStringList->Sorted = true. I don't know why I thought so but there
>> is the method,
>
> Yes, it actually uses function
Hello Arno,
On Tue, Dec 7, 2010 at 1:57 PM, Arno Garrels wrote:
> Fastream Technologies wrote:
> > As far as I know, the TStringList->AddObject() method uses binary
> > search for finding the correct index to insert when
> > TStringList->Sorted = true. I don't know why I thought so but there
> >
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
Fastream Technologies wrote:
> As far as I know, the TStringList->AddObject() method uses binary
> search for finding the correct index to insert when
> TStringList->Sorted = true. I don't know why I thought so but there
> is the method,
Yes, it actually uses function QuickSort but that is still
Hi Arno,
On Tue, Dec 7, 2010 at 12:42 PM, Arno Garrels wrote:
> Fastream Technologies wrote:
> > 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
Fastream Technologies wrote:
> 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
Related to thread: "Strange ICS application issue (MadExcept report)"
http://marc.info/?l=twsocket&m=129137495622903&w=2
{code}
program SslContextFreeNotificationTest;
{ Test case thread-safe TSslContext.FreeNotification and
TSslContext.RemoveFreeNotification.
Requires at least ICSv7 SVN revi
18 matches
Mail list logo