If your Node.js code is littered with console.log statements are you inviting performance issues? Is it worth debug/production toggling this on/off? I realized logging is import
console.log
slows down chrome because it is actually interfacing with the DOM on every call. The entire inspect element
system is actually just tons of DOM elements. When you call console.log
in the browser it it having to append a new element to the console
on every call.
You can see how console.log
is really just HTML by right clicking on an element in console
and clicking inspect element
. This will in fact open a new console
inspecting an already existing console
. :D
If you are really that worried about performance you could always remove the console.log
feature completely(not really advised because it could get confusing). You basically can noop
the function in the browser or server side. No more console.log
no more speed impact :D
console.log=function(){};