visionmedia/debug — pull request #25 by JeanHuguesRobert (2012-10-25 23:13:45+00:00)
Title: [de,bug] = debug.faster(name); de&&bug("faster")

When a mode is disabled, there remains some significant overhead due to the evaluation of the parameter sent to the debugger. i.e. that parameter is actually discarded by the noop debugger. So, why should we built it in the first place?

A solution is to invoke the debugger only when it is enabled. This requires an additional flag. debug.faster() returns both that flag and the debugger.

The "de&&bug" pattern is a somehow "hacky" way to use these results.

Benefits: reduces the need to remove tracing instrumentation from production code, may help debugging in these situations.

Cheers.

Jean Hugues