Sluggish performance problem isolated
I've come back to using IDEA, and was again frustrated by the really sluggish text editor. It affects all typing, but is particularly evident when inserting new lines (i.e. pressing return) and deleting text. My computer is not the fastest but it's OK: a dual-core E7400 @ 2.8 GHz, about 3 years old.
However I notice that it's only a problem with some files in my project. So I made a copy of one of the sluggish files and found that commenting out some sections made the editor fast again. I reduced the problem to this as the minimum example the produces the problem:
object Test {
List("abc").head.split("")
}
Oddly enough, the dramatic slow-down doesn't occur if
a) we substitute List("abc").head with "abc"
b) we use some method other than split, e.g. startsWith
With the above code I see the CPU utilisation going to 50%+ (I have a dual core so fully using one core) when inserting lines / deleting them again / general typing. If I comment the above line out, CPU usage is at around 15% while typing.
It is completely weird as I can't see any logical reason for the huge CPU burn. It seems you probably have a major bug that needs fixing. (I've noticed sluggishness since I first used IDEA with Scala nearly 2 years ago, so it's probably something long-standing.)
Please sign in to leave a comment.
This document instructs how to capture a performance snapshot that will help to identify what's going wrong:
http://devnet.jetbrains.com/docs/DOC-192
Can you also please include the version of IntellIJ and the Scala plugin that you are using?
Poor performance when hitting Enter might be related to Language Injection, which detects if the contents of string literals should be highlighted as SQL/Regex etc. Try disabling this with a setting (see attached screenshot).
Attachment(s):
Screen Shot 2013-05-04 at 8.51.26 AM.png
Not a real answer, but whenever I have this problem, I either select File ->Power Save Mode, and/or disable Scala type-aware highlighting (greenish "[T]" icon in the bottom right). This also takes away a lot of power and some stuff becomes manual (e.g. invoking auto-completion with ctrl+space), but it really helps when the computer seems to slow down to halt. (And also very useful when travelling on batteries)
best, .h.h.
Sorry, I don't mean to hijack this thread, but I'm actually running into a severe performance degrading problem myself now. I basically have to work with power save mode enabled all the time, which is really annoying because I miss tools, suggestions and shortcuts.
It is as if there is permanent background threads running with heavy load. I look into activity monitor, and as soon as I move the cursor, try to select a menu or whatever action, it shoots up to 100% and stays there for a while. It means I cannot even have smooth cursor motion, opening a menu takes like 3 seconds etc. This is on a 2.66 GHz Core i7 Mac Book Pro, very fast machine.
I already have disabled type aware highlighting, and in the Scala preferences, I reduced implicit scope to 3, and checked "Disable parsing of document comments", "Disable language injection". No luck, the only thing that helps is "Power Save Mode".
Do I understand that link correctly, the CPU snapshot function is only available in Ultimate but not CE?
Is this a known problem with the last or so Scala plugin update?
Thanks, ..h.h..
Jason - thanks for the info on turning off Language Injection - that does indeed seem to solve the problem of the unresponsive GUI! I will make sure to turn this off in all my projects from now on.
I am using the Community Edition so I don't think I have access to the CPU snapshot tool. I'm using the latest versions of IntelliJ (12.1.2) and Scala plugin (0.7.264), but like I mentioned, it's not a new problem.
Just now I tried starting a completely new empty project, and the example above does indeed still exhibit the same problem until Language Injection is turned off, so it was nothing to do with the large number of objects/classes in my other project.
Thanks Hanns - I tried it but neither Power Saving nor disabling type-aware highlighting help in my case. It does seem to be this Language Injection thing that Jason mentioned.
IntelliJ can't bundle the YourKit agent with the open source community edition. But you can obtain that by downloading an evaluation of the Ultimate Edition, or an evaluation of YourKit itself. Then you can capture CPU snapshots in the CE.
-jason
Hanns, can you give me CPU snapshot either for unresponsive GUI in your case (plugin 0.7.264).
There are few more known things, which can cause it, and which have workarounds.
Best regards,
Alexander Podkhalyuzin.
I definetely need CPU snapshot to suggest workaround/fix for your problem.
Very common problem with freezings is opened Structure View. Just close it and use only on demand (Ctrl+F12).
Best regards,
Alexander Podkhalyuzin.
Yes, sorry, I hadn't had time to do the installation of Ultimate / YourKit. I'm in a production right now, so I don't know when is going to be the next moment I can go into this, but it's on my radar.
I can exlude Structure-View from the possible culprits, because I always have that closed.
As I said, turning on Power Save does the trick (but I miss the disabled functionality dearly). I am also seeing heap memory growing constantly over time, suggesting perhaps memory leaks, but on the other hand, it doesn't seem to be directly related to the performance. E.g. I have a project open right now, heap is already at 650 MB, but GUI still normally responsive.
Best, .h.h.
@Jason Zaugg I am not using Scala, but definitely the problem is on what you talk about, so do you any idea in what settings part I can move on to avoid this issue? Thanks in advance