Does replacing console.log
with console.debug
in a quite heavy javascript application affect in any way the overall perfomance?
Thanks
Eg.
const startTime = new Date().getTime();
for (var id = 0; id < 100000000; id++) {
console.log('test') // vs console.debug('test')
}
console.log(new Date().getTime()-startTime);
In Chrome nowadays console.debug
logs only appears when level "Verbose" is selected so I assumed it would be slightly faster but it's actually slighty slower according to my benchmark results therefore I would appreciate some insights.
Thanks
UPDATE - Some heuristic results:
Using console.debug
instead of console.log
in long running processes, I noticed a slight (~5/10%) improvement in memory usage both in Chrome and Opera (latest version).