discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [GSWHackers] Future of GnusStep WebObject


From: Helge Hess
Subject: Re: [GSWHackers] Future of GnusStep WebObject
Date: Tue, 2 Mar 2004 17:03:22 +0100

On Mar 2, 2004, at 4:27 PM, NeXT wrote:
It will be a significantly slower, but is going to provide all the KVC features available in gstep-base.

Why should it be "significantly" slower? It could not be cached, or KVC itself is so slow?

Well, KVC only works with objects, which has a significant speed hit if you do a lot of KVC on base types, which is very common with WO. Of course KVC itself is not inherently slow.

For example a conditional used in a repetition on thousands of objects:
Component.wod:
  Condition: WOConditional {
    condition = showImage;
  }
Component.m:
  - (BOOL)showImage {
    return YES;
  }
WOConditional.m:
...
if ([[self->condition valueInComponent:[context component]] boolValue])

Since there is no -boolValueForKey:, the naive implementation of WOKeyPathAssociation will lookup the method, turn the (char) result into a NSNumber object, then in the dynamic element will in turn convert the number into a char (/BOOL) for the actual check (notably this is also hit by the fact that we can't detect BOOL here which allows for further optimizations). This is about 2-10 times slower than directly accessing the bool result, do this in loops and see ;-)
One of the optimizations in WOKeyPathAssociation, but there are others.

Some years of profiling already went into SOPE.

PS)
I'm going to test more extensively (with some real load) SOPE and GSWeb, I'm searching for all default options and documentations on both of them. Does anybody know good source of information? (Yes, source is very good source of information, but you know :-)

On SOPE:
  http://www.opengroupware.org/en/devs/sope/
  http://docs.opengroupware.org/Members/helge/SOPE/

Not really much documentation though. But better than nothing ;-)

regards,
  Helge
--
http://docs.opengroupware.org/Members/helge/
OpenGroupware.org





reply via email to

[Prev in Thread] Current Thread [Next in Thread]