isn’t it too hypothetical? as a best practice usually there shouldn’t be any console.log in production build, but let assume we are bad developers and put console log everywhere.
console.log
shouldn’t have much impact when DevTools are not open, so the concern isn’t here.
But we want people to be able to use DevTools in most situation, and it might happen that you log something in a big loop without thinking too much of it, at least I don’t think this is uncommon.
This is not only about memory, but plain performance: the more objects we need to keep track of, the slower some lookups are going to be.
My concern might be hypothetical for sure, but even if we’d won’t have any perf or memory issue, it doesn’t mean this would be easy; the fact that all vendors DevTools are suffering from this is a good hint that there’s no easy solution.
another sad truth is that if you write down 10000 console.log in firefox dev tools it will kill the firefox and freeze i
Oh, would you have a test case for this? Or even better, maybe you could record a profile of it using the profiler and sharing the result here?
We made significant improvement to console performance in Firefox 101, so I’d be curious where the culprit is here