问题
I would like to know if opening browser developer tools really affect the application performance in any way. It's not about just considering opening the developer tools in the same window, it can be in a new window or the same window.
Also is there any difference in application rendering/performance if developer tool is not opened vs opened state?
回答1:
Yes, opening the developer tools of a browser has influence on the page's performance. This is because they observe different aspects of the page.
E.g. the JavaScript debugger influences the execution performance of the JavaScript, because it has to check for exceptions or whether the execution has to be stopped on a breakpoint.
Other panels influence page's performance in different ways, e.g. when rendering it.
Of course, the developers of those tools try to keep those effects at a minimum, though they can't be avoided completely.
Also, the developer tools normally only affect the performance of a page when they are enabled, with a few exceptions like error logging, which is also done while the tools are disabled.
回答2:
Opening the developer tools definitely affects performance, and not always in the way you might expect.
In Chrome I very frequently find opening developer tools whilst a page is running slowly, can improve the page's performance. I don't know why that is, but it's a very observable affect.
It will probably be worth instrumenting your page within your own code and logging general performance stats if you're worried about developer tool's influence. You can open the developer tools after make some actions and read the log after-the-fact.
来源:https://stackoverflow.com/questions/47466794/does-opening-browser-developer-tools-affect-application-performance