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 array

复制代码
 public 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 evaluate toString() 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

相关推荐
晚烛13 分钟前
CANN 数据流水线优化:从数据加载到模型输入的端到端加速
开发语言·网络·人工智能·python·深度学习
biter down28 分钟前
1.什么是GUI自动化测试
开发语言
聆风吟º38 分钟前
深入理解C语言 isupper 函数详解:判断字符是否为大写字母
c语言·开发语言·库函数·字符处理·isupper
代码小书生42 分钟前
time,一个时间操作的 Python 库!
开发语言·python·microsoft
C+-C资深大佬1 小时前
在C++中,const和#define有什么区别?
开发语言·c++
Deep-w1 小时前
【MATLAB】基于 MATLAB/Simulink 的无刷直流电机(BLDC)转速控制模糊 PID 算法
开发语言·算法·matlab
专注VB编程开发20年1 小时前
Python 的 C 扩展,本质上就是“去中心化的 COM”
java·服务器·开发语言·ide·python
LB21121 小时前
消灭并发重复调用:基于 Agent 调用 LLM 的分布式 Single-Flight 实战
java·开发语言·redis·分布式·agent
JAVA社区1 小时前
Java进阶全套教程(七)—— Redis超详细实战详解
java·linux·开发语言·redis·面试·职场和发展
qq_401700412 小时前
Qt 多线程编程
开发语言·qt