Repeated Call to CFC function is much slower than UDF version
For a project we were confronted with an unexpected behaviour from a CFC. Without going to much into the details of the project it comes down to the following: when we run through a set of records, let's say 100, and apply a formatting function on it, the overhead is 4-5 extra seconds when we call it from an instantiated component (only once) compared to when we hardcode it as a UDF. Since our application can process several thousands of records in 1 pass the overhead quickly goes over 100 seconds compared to the UDF.
I was wondering if there's any logical explanation to this behaviour. From what I understood a function called from a component shouldn't add any noticeable overhead after the component has been instantiated.
Our setup is a Coldfusion 8 Jrun installation running on Linux. We couldn't really find anything on the web documenting this (or what we found told us there shouldn't be any extra overhead). We could change the function call to a UDF call but we prefer to keep it in a CFC as there's more going on behind the scenes than just formatting the data.
B.
