Does opening browser developer tools affect application performance?

风格不统一 提交于 2020-07-08 10:37:11

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!