Chuck,

Try using the following code in addTraceStatement:

<cfif variables._modelGlue.configuration.debug EQ "none">
<cfreturn />
</cfif>

Please let us know how the performance of this code compares to the other
two approaches.

This method of accessing the framework configuration is not part of the
public API, but is used in some internal framework components for
performance. It is not intended for use in controllers or any other custom
application code.

Cheers,

-- Dennis

On Wed, Jan 13, 2010 at 12:44 PM, Chuck Savage <[email protected]> wrote:

> I know this thread is kind of old, but ran across it when it was
> mentioned in a new thread.  Basically following Chris' suggestion
> above, I got about a 50% improvement, but having it call
> getConfigSetting('debug') on every addTraceStatement() is rather slow.
>
> So I added a <cfset variables._debuggingEnabled = false> to the
> component definition, and these statements to the Init() just before
> the addTraceStatement() at the end of the function,
>
> <cfif arguments.modelglue.getConfigSetting('debug') NEQ "none">
>        <cfset variables._debuggingEnabled = true>
> </cfif>
>
> and added this <cfif variables._debuggingEnabled> around the code in
> addTraceStatement()
>
> At least a 90% improvement in speed!
>
>
-- 
Model-Glue Sites:
Home Page: http://www.model-glue.com
Documentation: http://docs.model-glue.com
Bug Tracker: http://bugs.model-glue.com
Blog: http://www.model-glue.com/blog

You received this message because you are subscribed to the Google
Groups "model-glue" 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/model-glue?hl=en

Reply via email to