|
From: | David Ayers |
Subject: | Re: [GSWHackers] Future of GnusStep WebObject |
Date: | Wed, 03 Mar 2004 14:34:08 +0100 |
User-agent: | Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.6) Gecko/20040113 |
Helge Hess wrote:
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.
Interesting... I actually prefer the approach that gnustep took in solving the main issue within -base/NSNumber which returns cached versions common NSNumber instances. This solves the root of this particular problem for a wider range of applications. Yet optimization within GSWeb and GDL2 is needed.
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 :-)
Documentation is definitely a missing for both GSWeb and GDL2. We are aware of this and I would argue it is one of the major issues that need to be addressed in some acceptable manor before we release any "user" packages of either project. Until then, I don't have much choice but to point you to Apple's documentation on WO45.
http://developer.apple.com/documentation/LegacyTechnologies/WebObjects/WebObjects_4.5/webobjects.html We're fully aware that this is serious issue. Cheers, David
[Prev in Thread] | Current Thread | [Next in Thread] |