Ask HN: How do you improve the performance of IntelliJ IDEs?
Something I've tried recently is changing from the default Java 11 JetBrains runtime to Amazon Corretto 15. Start up is blazingly fast now and overall the IDE feels faster once running as well, though I haven't profiled so that may just be an impression. There is a message when you go to change the runtime warning that you shouldn't do it unless asked to do so by JetBrains support, but that seems overly conservative and this has been (I think) the biggest improvement in performance for my set up so far. Font rendering was much worse initially but after some tweaking of font settings it's more than acceptable.
I'm also trying out using the Z garbage collector and setting the ratio of young to old generation to 1, as suggested here[1], as I often have multiple projects open at once. I'm not sure how much of an impact this is having though as I'm trying this all together, but the heap memory indicator does seem to fill up substantially more when indexing before a garbage collection happens.
[1]: https://www.jetbrains.com/help/idea/tuning-the-ide.html#common-jvm-options I'm so sick of this. I understand that VsCode is popular, but for Python and Rust, Intellij's management of multi-file projects, and code introspection is much nicer. But It's almost daily PyCharm hard locks up for me, or uses most of my available ram. I use these custom VM options. How do you change the JVM cleanly in a way which doesn't confuse the toolbox app or launching machinery? There is an action in IntelliJ - "Choose Boot Java Runtime for the IDE". I first downloaded the Corretto 15 JDK within IntelliJ itself as if I was going to use it as the SDK for a Java project, then it was available to me to select as a boot runtime in that action. Some more details here.[1] The first runtime I tried was Corretto 17 which crashed on me, and I had to delete some `idea.jdk` file somewhere or other to get IntelliJ to start up again. That file seems to contain which JVM to use when starting IntelliJ, I use Toolbox as well (on Ubuntu). [1]: https://www.jetbrains.com/help/idea/switching-boot-jdk.html Switching from the bundled JBR 11 to Corretto 15 launches fine in PyCharm, except the editor font is not what I'm used to with the regular JBR, so I will have to install that separately from the IDE, and hope it picks it up. It does feel snappier though, judging by some of the window operations, which always feel rather spongy and slow, even after the JVM has had a chance to warm up. JB should consider this change! I agree, it looks like JB are working on upgrading the default runtime to Java 17, but I think generally they could encourage developers to try out different runtimes anyway and report bugs rather than warning so strongly against it. I understand the JB runtime made some improvements to UI stuff, certainly the font rendering is much better in it, but at least for my setup that's not a big issue compared to things like indexing time. It'd be interesting to see a comparison of using different runtimes for IntelliJ, with proper profiling and the like. WOW. With Correto 15, I can zoom (control+mouse wheel) the text in the editor up and down immediately. With JBR 11 it takes about 10 goes to warm up the JVM. DataGrip is _greatly_ improved. The difference is night-and-day. I am using the Azul Zing JVM 15 with PyCharm 2021.3 EAP and it's so much more like a native application than with the JBR JVM 11. I have long felt that I have been working in molasses with my JetBrains tools up until this point. JetBrains need to come correct and update JBR to something modern, immediately.
-XX:+IgnoreUnrecognizedVMOptions
-XX:+UnlockExperimentalVMOptions
-XX:+UseZGC
-XX:-UseG1GC
-XX:NewRatio=1
-Xms4G
-Xmx4G