On Wed, Jan 28, 2009 at 10:33 AM, Henry <[email protected]> wrote: > Are you guys certain that oMM will be always less efficient? Didn't > creation (and attaching) methods into an object is also expensive in > CF8? Since beans needed to be created all the time, maybe the cost of > creation of methods will offset the slightly inefficient oMM?
If you really care about the milliseconds, try it for yourself. onMissingMethod() is pretty efficient in and of itself - it's wired directly into the method lookup so when ColdFusion sees this at runtime: obj.getFoo() it does the following: - lookup "getFoo" in obj - if not found, lookup "onMissingMethod" in obj - if still not found, error: no such method - invoke the function - either getFoo() or onMissingMethod() So, that adds about 10-20ms. However, the real cost comes from the dynamic code *inside* oMM. Typically you are manipulating strings and looking up properties and so on. That is far more expensive than just returning a simple variables scope item (or setting a simple variables scope item). So, yes, using oMM will always be slower. -- Sean A Corfield -- (904) 302-SEAN An Architect's View -- http://corfield.org/ "If you're not annoying somebody, you're not really alive." -- Margaret Atwood --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "CFCDev" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/cfcdev?hl=en -~----------~----~----~----~------~----~------~--~---
