IntelliJ Idea 2020.3.1 Is Out with Apple Silicon Support
blog.jetbrains.com
blog.jetbrains.com
- On a large file, or in a slow project, put the Inspection Level down a notch. (You can get to it from the Actions keyboard shortcut.) You can nudge it back up, including for whatever big file -- when needed.
- Install the plug-in "Automatic Power Saver," which does that automatically upon loss of focus. (Well, maybe down two notches?) I do notice the switch/transition sometimes but it makes my overall session so much smoother (mainly because browser and IDE aren't being slower than their combined slowness)
p.s. I've been dealing with JetBrains IDEs' slowness for 5+ years, have done the same workarounds you mentioned etc. I always have another fast editor set up, lately VS Code. For quick edits etc. I had a coworker who would use their JetBrains IDE only for the last stretch of their branch or ticket -- to get the inspections and other tools. I supposed I picked this up from them.
Two things to change to (likely) boost your JVM+IntelliJ performance:
1. Use the new ZGC garbage collector.
-XX:+UnlockExperimentalVMOptions -XX:+UseZGC
2. If you're using ZGC, it is fucking imperative you do not use compressed pointers. It will totally hose your system and you'll see unbelievable RAM thrashing (800mb to 16gb and back again within a few hundred milliseconds in one smallish project I have [and thats on a 5950x]). That is to say, after enabling ZGC, ensure you do NOT have the following configuration line:
-XX:+UseCompressedOops
I've been using ZGC for a few days and I have to say it's been fucking great. Before I'd get really long hangs due to GC; or eventually the editor would grind to a halt (after like 8 hours of usage). I've had the editor open for at least 48 hours now and it's just as fast as it was when I originally opened it.
Then there are the possible uses of G1 and Shenandoah.
This just in the context of OpenJDK, other implementations have their own JIT, AOT and GC variations to choose from.
So running on latest versions of a JDK already helps.
Me personally, I am happier using Eclipse and Netbeans anyway.
You can still get JRE, but they aren't as official as they used to be until Java 8.
And in any case, customization flags for which GC to use, or JIT caches, are part of any Java runtime implementation.
It'd be great to know exactly what sort of speed improvements this might bring (or if it's really faster at all).
It _seems_ like IJ could be scripted using the plugin system to do things like:
- Load and apply formatting to a 1 MB source file.
- Index an entire project.
- Run a regex find/replace on a code base.
- Load 50 code files and time how long it takes for each to be ready to display.
IntelliJ has an enormous number of features and people use their own subset of them. Not to mention things like plugins and other options for customization. It's a huge space.
I wholeheartedly agree there will always be very weird setups on very weird source, but if they can make the 80/20 run faster, hopefully a rising tide will lift all boats kind of thing
One example of variation is that the users might be writing code using different languages. The parser and static analysis for a project written in Go will be very different than a project written in Java. All the language-specific stuff is different code that has different performance characteristics.
As an analogy, it's sort of like testing browser performance for loading an "average" web page, when each web site has different performance, depending on how it was written. Load times for Hacker News aren't all that relevant for Gmail or the New York Times.
Yes, you can make a benchmark and optimize it, but you might not even be running the same code that real users are running, due to plugins.
Although I kind of like IDEA and (particularly) PyCharm in terms of functionality (and dark mode, which they've had for a while), I quit using them because I didn't like the sluggish/underwater feel.
Thanks for posting this -- I thought it was just me.
Speed difference of Rosetta vs native: It was unusable for me on Rosetta. Super delayed responses for everything, and used a lot of memory. I temporarily switched to the Exploration version of VS Code while I waited for Jetbrains to update. :)
This release makes the IDE so incredibly fast! Indexing dependencies happens magnitudes faster than Intel version. With many of my projects I have used in it, if you tried to hold your breath from the time you started the IDE until it was ready to begin editing you'd have passed out unconscious. Now, the IDE is ready to begin work quicker than you could recover from a heavy sneeze! It IS a breath of fresh air. Searching all files is about instantaneous; navigating file trees is snappy and responsive; opening Settings modals happens quickly. What a joy!
These must be macOS issues or problems with the limited thermal envelopes ofIntel Macs. I have noticed the same issue with my Intel MacBooks, it's slow and the fans spin loudly.
I never had that issue on Linux with a Ryzen CPU (3700X) though. The JetBrains IDEs are lightning-fast, including indexing. My only gripe is that they do not have native Wayland support and as a result the IDEs are blurry with GNOME fractional scaling.
There are some issues about this in their bug tracker, but the JetBrains personnel either do not seem to understand how the Linux graphics stack works (and come with non-solutions) or say that it is low on their priority list.
I have a ToolBox subscription (among other reasons because IntelliJ is still the best Java IDE). But with the progress that Visual Studio Code makes with e.g. Rust support and JetBrains' slow progress on many issues, I will probably switch to VS Code at some point.
I'm not planning on switching back over, but others in the family are and Jetbrains packages were always clearly "slow" so speed of the chips actually made a difference to my eyes.
https://youtrack.jetbrains.com/issue/JBR-526
I dropped my everything sub over this and then moved on to vscode once its vim plugin was of equal caliber.
That's enough HN for me today and I just started...
But it's in no way any worse on modern machines that what you see in your 2015 MacBook (I have several Macs and can attest). People complain despite getting better performance than what you get on later Macs/PCs.
The other case is too many / too slow plugins. Not all are made equal. But as far as the core functionality, there has been no regression all the years I'm using it.
I highly suspect the performance problems some people experience are due to plugins. When I was doing some Elixir/Phoenix work, the Elixir plugin made it unusable sometimes. Clearly that plugin had some serious issues which would appear at times. I have not had the same performance problems in Rubymine or in vanilla IDEA.
Or who knows; could be something about the projects - number or sizes of files, language used and references between files, etc.
Using the Azul jvm builds, my java test suites on the MBA M1 run in 1/2 the time compared to the 2017 MBP.
I'm excited to see what the real pro machines can do when they come out.
That won't work because of the missing W^X support in upstream releases. You need to backport patches.
apps are natively compiled for instruction sets eg: x86, x64, ARM64 etc.
M1 has an new instruction set. so Apps targeting (x64, x86) need to compile specially to run natively on M1 chip.
currently there are few apps which are native as the chip is new. Apple has provided rosetta emulator, which will emulate x86 apps to run on M1
strange, everyone talked rosetta emulator in every single benchmark.
NOTE: the above is my current understanding. it may be slightly or grossly incorrect in some areas
- audio code needs to be optimized for real time thread constrains. Many optimizations usually made by vectorizing rather than threading that would've lead to locks and synchronization not always possible for real-time processing. So not all SIMD code can be compiled just by changing a flag.
- machine specific code. While rare. Some companies still got such code for various reasons. And needs more complex transition.
- Not all companies were able to obtain DTK. We for example, got our first M1 machine 3 weeks ago.
- Backward support. While we'd like to have universal builds, musicians use their systems for years. We still support 10.7. With Big Sur Apple seems to break SHA1 signs making builds from Big Sur work reliably only on 10.11 or newer. (The first release to support SHA256 codesigns) https://news.ycombinator.com/user?id=rock_artist
Something in the lines of Wine, I guess.
Examples where it is required is any kind of self-modifying code, such as JITs and the like. Since IDEA is a java application that ships with it's own JRE, the aot translator can only translate the JRE parts and when the execution first jumps to freshly written memory the system bails to the emulator. Since the emulator is an order of magnitude (probably more...) slower than native, and the entire IDE runs on JIT, this is very bad.
[1] https://www.docker.com/blog/download-and-try-the-tech-previe...
IntelliJ, WebStorm, DataGrip, GoLand, RubyMine
https://confluence.jetbrains.com/display/IDEADEV/JetBrains+R...
Edit: is it because they ship a custom jdk and that the jdk is in C++?
1. An inotify library for detecting file changes. In this case, IntelliJ detected that it didn't have a binary for my architecture and just let me know it would be slower. Not a big deal.
2. The async profiler[0]. While available for other architectures, only x86_64 binaries are bundled with IntelliJ. And unfortunately, it didn't detect this either; it just quietly failed to work.
Hopefully with this patch they've also fixed these issues on linux-aarch64.
Azul uses their own implementation anyway, so whatever they do isn't a reflection of what OpenJDK supports right now.
It is AArch64, it's not like it's an incompatible ISA. The fact that it has extra platform features does not slow down the initial port.
I am also not sure what 'additional goodies' you are referring to, for which specs are available (you can currently only use the neural engine through Apple's framework)? The fact that it's the first CPU (AFAIK) that is ARMv8.6-A?
0. https://hg.openjdk.java.net/aarch64-port/jdk8/
1. https://packages.ubuntu.com/bionic/arm64/openjdk-8-jdk/filel...
https://www.infoq.com/news/2020/09/microsoft-windows-mac-arm...
Sure, they can make optimizations now or in the future for ARMv8.6-A or the Neural Engine (if they are ok with going through Apple's framework). But M1 could pretty much use the existing AArch64 code from day 1 and have good performance.
(See benchmarks that float around the net where OpenJDK on AWS Graviton is competitive with Intel CPUs.)
https://mail.openjdk.java.net/pipermail/hotspot-runtime-dev/...
> ...so whatever they do isn't a reflection of what OpenJDK supports right now.
I just wanted to point out that OpenJDK itself does support the architecture, and has for some time.