[Performance] [UI Freeze] Changing a constructor triggered a import fix and a search #4162
Unanswered
fedejeanne
asked this question in
Q&A
Replies: 1 comment
-
|
Here's the chain of events as I understand them:
My question is: wouldn't it be better (and possible) to have such expensive operations like fixing the imports working in a background thread and apply the changes to the current editor when they are ready? I'm not familiar with the internals of this mechanism... ... but I assume that it means that changes made by the user while the organize imports was running in the background will be overwritten. If that's the case, one could simply block the editor (and just the editor) until the organize imports is ready. WDYT? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

Uh oh!
There was an error while loading. Please reload this page.
-
Hello everyone,
I am looking into a performance issue reported by a colleague and I could use some help.
Details
The issue
The colleague reported that he merely changed the type of a parameter in a constructor (he went 2 levels up in the type hierarchy) and then he performed the same changes in 2 subclasses. When he changed the constructor in the 2nd subclass, the UI froze.
Example: from
java.nio.channels.Channeltojava.lang.AutoCloseableGo from this:
... to this:
In our specific case, both interfaces belong to an automatically generated Metamodel which is very big, so the the super-interface (
AutoCloseablein this example) has lots of sub-interfaces and implementations.This is what I see in the sample (main thread):
Which tells me:
ImportsFixwhich in turn triggered a searchwait, which would explain the UI freezeI wasn't (yet) able to deduce which is the other thread that is taking so much time.
Questions
Why was the fix triggered? Was it so that the compiler can go through the callers of the constructor and then recompile the code? AFAIK this shouldn't be necessary since the changes should produce no new compile errors.
Could it be that there is some other task (compilation, indexing, etc) meddling here and causing the freeze?
Thank you in advance for the help!
Beta Was this translation helpful? Give feedback.
All reactions