This is a question more for people like @Zackster or @micstriit – I’m curious to understand what kind of mental model I should have for a CFML template with Functions defined within it. For something like a .cfc that is instantiated and cached in memory, the persistence story seems more intuitive - it’s just an allocated class with functions bound to it and some data mixed in (probably not totally accurate, but that’s the story in my head).
Now, take something like an <cfinclude template="test.cfm">, where test.cfm includes a set of function() {} declarations. I understand that the CFML template is compiled to byte code; so, it’s not like the CFML and the functions are be compiled over-and-over every time the template is being included. But, I don’t have an instinct for what the “overhead” of the template include actually entails?
When I include the template, are the Functions being “re-declared” or is the underlying Function class being “re-instantiated”? Or, is the same Function instance basically being used every time that template executes?
I guess I’m trying to better understand the performance / overhead gap between a CFC and something like a <cfmodule> that has similar(ish) encapsulation of CFML + Functions.
Hope that’s clear - I just want to better flesh out my mental model for some of this stuff.