>>Non-scoped version ALWAYS runs 5-15 times FASTER than the scoped version! >>This is on CF8, 32-bit, 4 CPU Dell Server, Windows 2003. Could somebody run >>this on CF9 32/64 bit?
Exactly the same here under CF9. I inverted the two loops ie: scope first and non-scope second, just in case, and the results are the same : about 250 for scoped and 15 for non-scoped. >>Any ideas, how it can be? This is weird indeed, I would have expected exacly the same time. The only explanation I can see could be poor programing. I've written or modified at least half a dozen compilers in my career, and I've never seen symbols stored by scope (or type or any sort of other characteristic) first, then by name. Doing so could indeed make scoping a little more efficient. But this is not the way compilers (or interpreters like in the case of CF) are designed. They have an array of all symbols by name, and each symbol has characteristics. Then looking for variables.mySymbol would actually mean "look for mySymbol first, there may be several of them, each with a different scope, and then look for the one having scope variables". If the compiler is well designed, symbols will be sorted by name first, then by scope in the order they are searched. Your test prove one thing however: Programing ayatollahs just prescribe great principle they feel are logical, but they don't really know what they are talking about. ;-) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:344823 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm