[dev] datatree: getObject for nonexistent objects

Chuck Hagenbuch chuck at horde.org
Thu Jan 25 21:44:58 PST 2007


Quoting Karsten Fourmont <fourmont at gmx.de>:

> I just realized that calling DataTree:getObject is extremly costly  
> for nonexistent objects (with sql backend). If you do this:

Thanks for this analysis!

I was uncomfortable with the change at first, but I did some poking  
around and committed this set, which includes your change but also  
goes a bit beyond it:

http://lists.horde.org/archives/cvs/Week-of-Mon-20070122/064958.html

Now, when calling any of exists(), getId(), or getName(), if an object  
isn't already loaded, we simply check the backend for it instead of  
trying to load it and then seeing if it's there. This removes some of  
the "on-demand" aspect of the datatree, but that's in all likelihood a  
good thing. May result in a few bugs to iron out but I've already  
tested it with 6-7 datatree using apps plus the admin screens.

Let me know how that looks/performs,
-chuck

-- 
"we are plastered to the windshield of the bus that is time." - Chris


More information about the dev mailing list