General IDE lagginess (code completions, etc)
See original GitHub issueEnvironment
- IntelliJ Rust plugin version: 0.4.172.4687-221
- Rust toolchain version: 1.61.0 (fe5b13d68 2022-05-18) x86_64-pc-windows-msvc
- IDE name and version: IntelliJ IDEA 2022.1 Ultimate Edition (IU-221.5080.210)
- Operating system: Windows 10 10.0
- Macro expansion engine: new
- Name resolution engine: new
- Additional experimental features: org.rust.macros.proc
Problem description
Recently, code completion, and even general IDE experience often greatly lags. Code completion for something as simple as a variable name in the same scope can sometimes take 20 seconds to pop up.
Includes generally any other experience, like clicking to go to the source file of a reference (although the lagginess does depend on the feature at hand).
Cargo Check being turned on or off doesn’t change much (though of course cargo check certainly is laggier for obvious reasons; unsure if it’s a contributory factor as I often turn it on and off as needed).
Of course, this testing was done after indexing and everything was already finished.
My project is large (about 4k lines of code), so a large codebase may be a contributory factor as well.
Also, as I’ve linked to an issue at the end of the issue report, syntax highlighting is also affected just the same (could be the result of a large codebase?)
The issue doesn’t always happen, and changes with usage, so sometimes you may see code completions being snappy enough, but when you really get into your programming sweetspot where you’re really doing stuff, browsing the docs that pop up on hover, adding libs to cargo (and letting it finish indexing), etc, it pops up fairly frequently during real sessions (which gets you out of the zone).
-
It is unknown if it’s the IDE’s fault itself, but I seem to remember in the past using this plugin wasn’t so slow.
-
I have made every effort to make sure the IDE itself is getting what it needs to be fast. E.g. increasing VM memory, disabling unused plugins, turning off
import on the fly
-features. Myidea64.exe.vmoptions
config is below, just in case that’s impacting something negatively.
idea64.exe.vmoptions
:
Click to expand!
-Xms1024m
-Xmx8192m
-Xss64m
-XX:NewRatio=2
-Dfile.encoding=UTF-8
-XX:SoftRefLRUPolicyMSPerMB=250
-XX:NewSize=512m
-XX:MaxNewSize=512m
-XX:PermSize=512m
-XX:MaxPermSize=1024m
-XX:+UseParNewGC
-XX:ParallelGCThreads=4
-XX:MaxTenuringThreshold=1
-XX:SurvivorRatio=8
-XX:+UseCodeCacheFlushing
-XX:+AggressiveOpts
-XX:+CMSClassUnloadingEnabled
-XX:+CMSIncrementalMode
-XX:+CMSIncrementalPacing
-XX:+CMSParallelRemarkEnabled
-XX:CMSInitiatingOccupancyFraction=65
-XX:+CMSScavengeBeforeRemark
-XX:+UseCMSInitiatingOccupancyOnly
-XX:-TraceClassUnloading
-XX:+AlwaysPreTouch
-XX:+TieredCompilation
-XX:+DoEscapeAnalysis
-XX:+UnlockExperimentalVMOptions
-XX:LargePageSizeInBytes=256m
-XX:+DisableExplicitGC
-XX:+ExplicitGCInvokesConcurrent
-XX:+PrintGCDetails
-XX:+PrintFlagsFinal
-XX:+CMSPermGenSweepingEnabled
-XX:+UseAdaptiveGCBoundary
-XX:+UseSplitVerifier
-XX:CompileThreshold=10000
-XX:+UseCompressedStrings
-XX:+OptimizeStringConcat
-XX:+UseStringCache
-XX:+UseFastAccessorMethods
-XX:+UnlockDiagnosticVMOptions
-Djava.net.preferIPv4Stack=true
-XX:ErrorFile=$USER_HOME/java_error_in_idea_%p.log
-XX:HeapDumpPath=$USER_HOME/java_error_in_idea.hprof
-Dide.no.platform.update=true
Steps to reproduce
- None, as source is unknown, however, I’ve provided as much detail as I can in the description section.
Appears to be similar or the same as this issue here: https://github.com/intellij-rust/intellij-rust/issues/8920
Issue Analytics
- State:
- Created a year ago
- Comments:20 (7 by maintainers)
Sure thing! One of my projects I most worked on is this one, where this folder contains a ton of proc macro code source code, and this file contains heavy use of macros (proc macro and regular macros), and a lot of heavy macros are defined here. I’ve always had particular performance issues with these heavy macro files,
@HolgerGottChristensen, Your issue should be fixed in the nightly plugin. You can try it now (see instructions).
That actually was not a performance issue. Highlighting just stop at some point because of the bug with a macro expansion (the bug was introduced in
0.4.168
release because we rewritten the macro expansion code). I think I (hot)fixed the bug in #9280, and the fix is now released in the nightly plugin channel.