本文主要是介绍IntelliJ idea卡顿解决,我遇到的比较管用的方案,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
Setttings> Build, Execution,Deployment>Debugger> Data Views> Java
取消 Enable "toString()" object view;
Speed up debugging in IntelliJ
Yesterday, I observed painfully slow debugging in IntelliJ. Every step over or step in took almost 10 seconds to perform.
It was a simple Java console application having about some 88k entries in few arrays. I had successfully debugged applications having millions of entries in arrays, lists and maps before without any performance issues.
Then I looked at the
toString()
implementation of the custom object which I was holding in the arraypublic String toString() {StringBuilder s = new StringBuilder();s.append(V + " vertices, " + E + " edges " + NEWLINE);for (int v = 0; v < V; v++) {s.append(String.format("%d: ", v));for (int w : adj[v]) {s.append(String.format("%d ", w));}s.append(NEWLINE);}return s.toString();}
This
toString()
implementation was looping over all the 88k items and IntelliJ is configured to evaluatetoString()
after every step.Turning off the setting
Enable toString() data views
solved this problem of slow debugging.Incase you are experiencing slow debugging issues on IntelliJ, do make sure that this setting is turned off.
参考:
Speed up debugging in IntelliJ – Madhur Ahuja
这篇关于IntelliJ idea卡顿解决,我遇到的比较管用的方案的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!