question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

General IDE lagginess (code completions, etc)

See original GitHub issue

Environment

  • 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. My idea64.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:open
  • Created a year ago
  • Comments:20 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
MolotovCherrycommented, Sep 6, 2022

@MolotovCherry, Glad to hear! We’re working hard on performance issues last months, but still we have a lot to do in this direction. If you work on some open-source project, could you please link it here along with a file in that project where you particularly experiencing lagginess? Then we could better test our plugin performance against your project.

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,

1reaction
vlad20012commented, Sep 2, 2022

@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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Modern IDEs are magic. Why are so many coders still using ...
With code completion, Git control, and even automatic deployment systems, modern IDEs are a Swiss Army Knife of features.
Read more >
2020.2 User interface very laggy/slow response (macOS ...
Typing, scrolling, etc. works perfectly everywhere, but not in IDEA. In IDEA it lags only in Java files for me, so is probably...
Read more >
Why Neovim is the best code editor / IDE for developers
I've always leaned more towards a minimalist text editor with syntax highlighting, linting, and code completion, but a new requirement this ...
Read more >
Xojo IDE becomes slower from Copy and Paste - If Not Nil
In many posts it was spoken about the effect that the xojo IDE is ... When running the IDE and it has to...
Read more >
Which is the best IDE for JavaScript development in 2022?
It also has auto code completion, supports multiple projects and multiple section editing, etc. Features: It has an integrated package manager.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found