javascript Chrome Dev Tools 在大型 Web 应用程序中的响应速度非常慢
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/6609558/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Chrome Dev Tools very slow to respond in large web app
提问by wilsonpage
I have a large, javascript heavy web app that I am working on. I am experiencing very slow response times from Chrome Dev Tools for XHR responses and console loggging (3-5 secs). The actual app is running fast and responsive, only dev tools looks like it is suffering.
我正在开发一个大型的 javascript 重磅网络应用程序。我遇到 Chrome Dev Tools 的 XHR 响应和控制台日志记录的响应时间非常慢(3-5 秒)。实际的应用程序运行速度快且响应迅速,只有开发工具看起来有问题。
Does anyone have any idea why Chrome Dev Tools is becoming sluggish as my app grows?
有谁知道为什么 Chrome Dev Tools 随着我的应用程序增长而变得迟钝?
采纳答案by Mike West
Devtools are like any other debugger; they hook into the normal processing flow of an application, and store quite a bit more information than is normally required. This is much more work than simply rendering the page without debugging enabled, so it will indeed be slower.
Devtools 就像任何其他调试器一样;它们与应用程序的正常处理流程挂钩,并存储比通常所需的信息多得多的信息。这比简单地渲染页面而不启用调试要多得多,所以它确实会更慢。
That said, 3 seconds to respond to console.log
seems high. I'd suggest that you first test the application in a nightly version of WebKit. If it's responsive in WebKit, but not in Chrome, please file a bug against the inspector via http://new.crbug.com/along with any information you can provide about what scenario causes the slowness.
也就是说,3 秒的响应时间console.log
似乎很高。我建议您首先在WebKit的夜间版本中测试该应用程序。如果它在 WebKit 中响应,但在 Chrome 中没有响应,请通过http://new.crbug.com/向检查器提交错误以及您可以提供的有关导致缓慢的情况的任何信息。
If it's equally sluggish in WebKit, please file a bug against WebKit's Inspector component: https://bugs.webkit.org/enter_bug.cgi
如果它在 WebKit 中同样缓慢,请针对 WebKit 的 Inspector 组件提交错误:https: //bugs.webkit.org/enter_bug.cgi
Either way, post the bug ID here, and I'll see that it's triaged into the correct team.
无论哪种方式,在这里发布错误 ID,我都会看到它被分类到正确的团队中。
回答by Colin Claverie
I "fixed" the slow chrome developer tool by (under SOURCES tab)
我通过(在 SOURCES 选项卡下)“修复”了慢速 chrome 开发人员工具
- clearing the "watch" list that accumulated over time...
- clearing all the "snippets", i had dozens as well...
- 清除随着时间累积的“监视”列表……
- 清除所有“片段”,我也有几十个......
Not sure which of both made the most difference, but it certainly made a difference
不确定两者中的哪一个最不同,但它肯定有所不同
回答by AsGoodAsItGets
This is an old question, but it may help someone landing here later like I did.
这是一个老问题,但它可能有助于像我一样稍后登陆这里的人。
Using Chrome 46.x/47.x on Linux (RHEL 7), none of the proposed solutions worked for me. What did work was to disable the setting "Use hardware acceleration when available", in the advanced browser settings.
在 Linux (RHEL 7) 上使用 Chrome 46.x/47.x,没有一个提议的解决方案适合我。有效的是在高级浏览器设置中禁用设置“可用时使用硬件加速”。
I noticed in the process monitor/list that the Chrome renderer was taking up a lot of CPU, even putting a breakpoint or stepping throught statements in the debugger would take 10+ seconds!
我在进程监视器/列表中注意到 Chrome 渲染器占用了大量 CPU,即使在调试器中放置断点或单步执行语句也需要 10 多秒!
Might be worth a shot.
可能值得一试。
回答by Jehong Ahn
Undock the developer tools into separate window. In my case, it's work.
将开发人员工具取消停靠到单独的窗口中。就我而言,这是工作。
回答by pgoostree
I struggled with this also, to the point where stepping through code using the chrome debugger was just so slow it took hours away from my productive development time. In watching the CPU utilization when debugging in chrome I would see it use up to as much at 40% of all 4 cores of my processor. I tried everything to no avail. Finally, I tried making the browser window of the page I was debugging as small as I could without losing any of the required view and miraculously it solved the problem. So, now I keep my debugger window popped out in a separate window, and make the window of the page I am debugging as small as I can and my debugging experience is very fast again. I have tested this over a period of weeks and it has held out. Hope this helps someone.
我也为此苦苦挣扎,以至于使用 chrome 调试器单步调试代码太慢了,我的生产开发时间花了几个小时。在用 chrome 调试时观察 CPU 利用率时,我会看到它使用了我处理器所有 4 个内核的 40%。我尝试了一切都无济于事。最后,我尝试使我正在调试的页面的浏览器窗口尽可能小而不会丢失任何所需的视图,并且奇迹般地解决了问题。所以,现在我让我的调试器窗口在一个单独的窗口中弹出,并使我正在调试的页面窗口尽可能小,我的调试体验再次非常快。我已经在数周内对此进行了测试,并且它一直保持不变。希望这可以帮助某人。