I was noticing in doing my performance testing on a site using a debugging template that I was getting really slow performance on a page that does nothing but set default variables.
So I have a test page I setup and am seeing something really strange.
I have an include file that has 247 default variables for a site. That include takes about 50ms-70ms which seems really high to me. So I moved the values to a page instead of the include and wrapped them in a cftimer and the results remained the exact same.
I did a test and if I just do a
<cfset _site.blah = "">
I get the bad performance
doing a find and replace and change _site to variables._site
<cfset variables._site.blah = "">
and all the performance issues go away.
What my question is HOW IS THIS POSSIBLE? If the default for un-scoped variables is the variables scope how can they perform different? I am not accessing the variables so scope cascading does not come in to play here.
The trycf results are a puzzler, but it looks like the 5.3 results on your laptop are more as-expected. I can’t tell much without some deep testing of my own.
It looks to me like the snippets in trycf.com are executed inside a function, and not as a standalone script.
That would explain the Local over Variables preference, as well as the discrepancy with @Zackster’s results on his local machine, which I expect that he ran as a standalone script.