Google Chrome Developer Toolkit is Slow

前端 未结 10 571
星月不相逢
星月不相逢 2021-02-01 01:38

I have been using Google Chrome\'s dev tool kit (element inspection, stack trace, javascript debugging, etc.) for some time with great success.

However, about two weeks

10条回答
  •  有刺的猬
    2021-02-01 02:14

    I had a problem like this; opening the debugger window was sluggish (10-20 seconds) and also every time I stepped over code, no matter how simple, I experienced a long delay (10-20 seconds).

    The cause for me was that I had some large arrays (1000s of entries, 10s of MB of data) in scope. The debugger pre-renders all in-scope data (including all globals, everything hanging off Window, and all parameters to all functions on the call stack) for display in the "Scope Variables" window. If that tree of data is large, then each step it will take the debugger a long time to recalculate the variable inspection tree.

    I was able to work around the problem by (a) moving the large array into a non-global scope, to keep it off of Window, and then (b) moving the rest of my program into a separate scope. Like so:

    
    

    Unfortunately if you need to step through code that references the large array, then I don't have a workaround.

提交回复
热议问题