Re: speed daemons
Re: speed daemons
- Subject: Re: speed daemons
- From: Georg Tuparev <email@hidden>
- Date: Thu, 30 Aug 2001 09:13:43 +0200
On Thursday, August 30, 2001, at 06:26 AM, Chilton Webb wrote:
>
I'm writing a server. Currently it's all in C, and uses sockets to talk
>
to the client, (which is also a custom app). No performance problems
>
that I can see, but soon we'll be taking on large numbers of clients
>
(thousands).
Go to CyCosmos.com, create an account, and play a bit. You will see
event list scrolling in the top right frame (e.g. user logged in/out
checked your avatar, etc). The deamon that collects and dispatches all
events to all the instances of the WO application is written in ObjC.
When I was testing it for the last time, it could easily handle ca. 1M
user sessions. So the answer is in theory yes, it is doable. But it
depends on what are you doing, and how are you doing it. In many cases
the OO overhead is insignificant. But, I can see also that it might be a
performance problem. In general the OO overhead behaves like O(n) where
n is the number of method calls. If your central algorithm is of type
O(log(n)) then you might have to circumvent the dynamic binding and call
particular method as a function. Here an example:
void (*numberCruncher)(id, SEL, double);
int i;
numberCruncher = (void(*)(id, SEL, double)[calculator
methodForSelector@selector(forcefield:)];
for (i = 1, i <= numCells; i++)
numberCruncher(list[i], @selector(setField:),list[i-1]+rms(i));
Looks ugly, but performs as fast as C.
Georg Tuparev
Tuparev Technologies
Klipper 13
1186 VR Amstelveen
The Netherlands
Mobile: +31-6-55798196