JetBrains / JetBrainsRuntime

Runtime environment based on OpenJDK for running IntelliJ Platform-based products on Windows, macOS, and Linux
GNU General Public License v2.0
1.32k stars 196 forks source link

Incredibly slow compared to any other JVM #56

Open prof7bit opened 3 years ago

prof7bit commented 3 years ago

I assume this is the runtime that is bundled with products like PyCharm and other IDEs.

Recently I was wondering why PyCharm has become so painfully slow that coding is not fun anymore at all. I remember it used to be MUCH faster and more responsive a year ago.

Today out of sheer desperation I switched my PyCharm installation to another JVM (first I tried Oracle 15 and then OpenJDK 11 (Kubuntu default) and OpenJDK 15, it does not matter which one I choose, any other JVM is faster than JetBrainsRuntime by a factor of 5 at least!

So probably in your recent release builds you accidentially got some configuration option wrong.

Just in case you wonder why people are complaining their Jetbrains IDE has become so painfully slow recently: It is the incredibly slow Java runtime that is bundled with it!

bulenkov commented 3 years ago

@prof7bit How did you measure this? It would be very helpful if you provide some specific scenarios to reproduce the performance problem.

prof7bit commented 3 years ago

I observed this on two different PCs, one has Kubuntu 20.4 and one that has Kubuntu 20.10.

bulenkov commented 3 years ago

We will take a look at Kubuntu, thanks. It looks like a temporary problem. To identify it faster, could you please take a CPU snapshot and send it to us? https://intellij-support.jetbrains.com/hc/en-us/articles/207241235-Reporting-performance-problems

prof7bit commented 3 years ago

I just took the time it takes to start up to a defined state. The IDE has two editor windows open side by side and a terminal in the bottom. I took the time it takes from starting the IDE until the prompt appears in the terminal:

around 14 seconds with Ubuntu OpenJDK and 42 seconds with JetBrains:

PyCharm 2020.3.3 (Community Edition) Build #PC-203.7148.72, built on January 27, 2021 Runtime version: 15+36-Ubuntu-1 amd64 VM: OpenJDK 64-Bit Server VM by Private Build

14:43 13:89 13:96 15:23

PyCharm 2020.3.3 (Community Edition) Build #PC-203.7148.72, built on January 27, 2021 Runtime version: 11.0.9.1+11-b1145.77 amd64 VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.

42:02 42:55 41:17 42:28


I'm going to post the CPU snapshot as you suggested in a few minutes...

Edit: I can't find this option in PyCharm :-(

prof7bit commented 3 years ago

Sorry, I can't find anything about "CPU snapshot" anywhere in PyCharm. All I can see is a zip with tons of logs ("collect diagnostic data"), is that what you mean?

bulenkov commented 3 years ago

It should be in your home dir. image Here is a step by step instruction: https://intellij-support.jetbrains.com/hc/en-us/articles/207241235-Reporting-performance-problems#CPU_Snapshot_2019_2

prof7bit commented 3 years ago

This is funny: The screenshot you provided above is nowhere to be found on the link you gave, even a google search for the words "community editions do not bundle performance testing plugin" will give me a link to this website but when I click on it it does not show the above text anywhere that mentions I need a plugin.

I'm going to install the plugin and try to see if I can get these snapshots.

prof7bit commented 3 years ago

Upload id: 2021_02_15_LpjLx36AsBRjTtue

(files: fast-with-openjdk-11-PC-203.7148.72_bernd_15.02.2021_10.55.57.zip, slow-with-jetbrains-PC-203.7148.72_bernd_15.02.2021_10.59.46.zip)

Now I am sitting on my work PC in the office and my startup times are: 23:44 with JetBrains 08:56 with Ubuntu OpenJDK-11

I followed the "profile slow startup" instructions and generated two snapshots, one with the original JVM and one with Ubuntu OpenJDK.

prof7bit commented 3 years ago

It happens on two Kubuntu machines (even when running an Openbox session without any KDE at all) It does NOT happen on a Windows 7 VM It does NOT happen on a Lubuntu 20.4 VM

I removed ~/.local/share/JetBrains and ~/.config/Jetbrains and downloaded and uzipped a fresh copy of pyCharm and it STILL happens on my Kubuntu machine.

Same effect with a fresh install if IntelliJ IDEA and an empty project (this PC has never seen IDEA before), 16 seconds with JetBrains runtime and 7 seconds with OpenJDK.

Could you already have a look at the snapshot files what is causing this? Is there a tool available so I can look at it too?

prof7bit commented 3 years ago

I found an obvious hint while watching the CPU utilization during startup:

with OpenJDK all 4 cores are nearly maxed out continuously the entire time until the IDE is started.

with JetBrains after the splash screen when the empty IDE window appears and the small progress dialog in the middle appears all cores except one drop to zero and only one thread keeps running at 100%.

The total time burnt by the the java process during startup (as reported by htop in the TIME+ column) is almost identical (52 seconds for OpenJDK vs 56 seconds JetBrains) despite JetBrains running more than twice as long until it is finished.

avu commented 2 years ago

@prof7bit do you still experience this issue (with the latest versions of our products)?