On 5 mar, 02:26, Marcel Laverdet <[email protected]> wrote:
> > de&&bug( msg) is much faster when traces are disabled
>
> Is this a true statement?

"much faster" than debug( msg) of course ;)

When traces are disabled, the right side of the && operator is not
evaluated ; as a result the call to some "debug( msg)" function is
avoided and  consequently "msg" itself does not even need to be
evaluated nor sent as a parameter to debug(). I suspect that the only
way to reduce further the overhead of assert/trace in production mode
is some variation around the conditional #define in C where DEBUG and
ASSERT expand to "nothing" in production mode ; ie "anything" is
slower than "nothing" (that's a true statement I guess...)

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" 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/nodejs?hl=en?hl=en

Reply via email to