4 ms·
Anecdotally I find these Java IDEs - IntelliJ, Eclipse, etc. all painfully slow. Is there some magic configuration that's required to make them run decently?
by fareesh 5y ago
Anecdotally I find these Java IDEs - IntelliJ, Eclipse, etc. all painfully slow. Is there some magic configuration that's required to make them run decently?
On Android Studio, for example, there are times when I tap a menu item and it takes a good 5-6 seconds to open. I'm on one of the latest Ryzen processors and I have 16GB RAM. Do I need 32GB?
EDIT: SSD for my work files and OS and the applications themselves
- david_allison 5y agoI have 16GB for Android development and it gets painful, 32GB is recommended. Are you paging to disk? You may want to increase your heap size if you haven't already. https://developer.android.com/studio/intro/studio-config#adjusting_heap_size https://developer.android.com/studio/intro/studio-config#adj...
- KronisLV 5y agoMy current configuration is: Ryzen 3 1200, 16 GB of RAM, SSD for the OS, another SSD for the IDEs/code. In my experience: - NetBeans is reasonably fast for code editing, but slows down once you try to do refactoring or even search for things; overall it ends up feeling a bit lacking when compared against the alternatives - Eclipse is always horrible, both in regards to usability, as well as performance; some people swear by its extensibility and workflows, but i do not share their experiences - IntelliJ (and other JetBrains products) are slow when opening and indexing projects, as well as somewhat slow when they aren't given >2 GB of memory for the IDE itself, or swap is hit; perhaps the best functionality though - Android Studio feels like an exception to the above, as it's almost always been slow in my experience Some suggestions: - don't attempt to do anything when your project is opening/indexing, especially in cases of medium to large codebases (e.g. >100k SLoC) or large amounts of dependencies (e.g. >20 packages) - disk performance also probably matters a lot in this case, i'd suggest using SSDs for any development workstation and HDDs only for storing data for longer periods of time, or fewer larger files - consider increasing the amount of memory that's available to the IDE itself, which you should be able to do in the case of IntelliJ through Help > Change Memory Settings - the JDK that you use may or may not have an impact on this, switching from Oracle JDK to OpenJDK has improved performance in prod projects by a factor of 10, might have minute improvements for IDEs - consider whether you need swap or a paging file, since if memory gets persisted to disk, accessing it might slow things down more than necessary, or decrease your OSes swappiness value https://www.howtogeek.com/449691/what-is-swapiness-on-linux-and-how-to-change-it/ The latter two steps probably aren't too important, as long as you have enough memory and a fast enough disk, you should be good: currently IntelliJ menus open in <1 second once the project has been indexed and when there are no problematic third party plugins present, e.g. Codota (an earlier version of which thrashed my CPU usage).
- jcelerier 5y agoIt kills me that given all that people would still say "java is as fast as c++!"
- KronisLV 5y agoThat's a simple statement about a complicated situation, which doesn't do it justice. When comparing synthetic benchmarks, C++ is 1-5x faster: https://benchmarksgame-team.pages.debian.net/benchmarksgame/fastest/gpp-java.html https://benchmarksgame-team.pages.debian.net/benchmarksgame/... When comparing real world benchmarks (webdev), C++ still is faster, but only sometimes, it all depends on the framework used: https://www.techempower.com/benchmarks/#section=data-r20&hw=ph&test=composite&l=ziimbj-sf https://www.techempower.com/benchmarks/#section=data-r20&hw=... I think that this is largely a sign of various small inefficiencies and design decisions adding up in any piece of code - and the larger the codebase, the more of these there will be, which is why for non-trivial programs C++ can actually be slower than Java. Not because the ideal C++ code is slower than the ideal Java code (with realistic runtimes), but rather because in practice you'll never get to this ideal code. JetBrains paid a certain price in performance, just so they could get rich cross platform IDEs working. That said, Visual Studio is written in both C++ and C#, and suffers similarly in many hardware configurations. I think Wirth's law is at play here: https://en.wikipedia.org/wiki/Wirth%27s_law https://en.wikipedia.org/wiki/Wirth%27s_law With that in mind, write code in whatever will give you the best results, whether you're optimizing for speed/ease of development, or runtime performance. In most companies, the former two are more important than the latter, which is okay with me, as long as i don't have to pay for their servers.
- jcelerier 5y ago> I think that this is largely a sign of various small inefficiencies and design decisions adding up in any piece of code - and the larger the codebase, the more of these there will be, which is why for non-trivial programs C++ can actually be slower than Java. Not because the ideal C++ code is slower than the ideal Java code (with realistic runtimes), but rather because in practice you'll never get to this ideal code. but this isn't what we observe in practice: all the C++ apps I know and use regularly consistently work better than their Java equivalents AND perform faster. Jetbrains IDEs are unuseable for me coming from Qt Creator and I don't understand how anyone can stay sane with them - and I try CLion pretty much every year since it's been announced. Besides, what matters to compare language is not how the ideal, infinitely optimized app looks like, but how the average one does. And, to me, the average Java app is unambiguously terrible when compared to the average C++ one.
- drran 5y agoWhy not to use `perf` to figure out why Eclipse is slow, fix the problem, and then send a patch?