|Understanding why my Xtend editor is slow [message #1827587]
||Mon, 18 May 2020 18:51
| Elie Richa
Registered: February 2016
I'm experiencing regular hangs in the Xtend editor on a file of about 2000 lines of code. I'd like to understand what could be the bottleneck, i.e. which Xtend language features might be slowing down the editor, so that I could try to avoid them in my code and hopefully make editing that file bearable again.
Here are the symptoms:
- While editing that file in Eclipse, every ~3 seconds of typing (no save) the editor hangs for about 3 to 7 seconds. This makes editing the file without a nervous breakdown very challenging :) I sometimes resort to using a plain text editor.
- If I keep typing during the hang, the editor takes into account my input after it gets unblocked.
- Hangs occur even if I'm typing comments
- Disabling "Project" > "Build Automatically" doesn't solve the issue. I think this only affects what happens after saving the file.
- During the hang, the Progress view sometimes shows "Refreshing outline" and about 5 copies of "Updating editor state (Waiting)". Closing the Outline view didn't help (but "Refreshing outline" disappears). I don't know if the other jobs have anything to do with the hangs.
Here are the features of Xtend that I use in that large file:
- ~8 create methods
- ~8 dispatch methods (some are also create methods)
- A lot of triple-quoted strings.
- A lot of uses of => operator with [ ] lambdas
- 5 "extension" class fields providing utility methods on certain object types
- About 11 "import static extension" from EcoreUtil and EcoreUtil2. I tried avoiding the wildcard version "import static extension EcoreUtil.*" in an attempt to solve the hangs, but it didn't solve it and I'm not sure it even improved anything.
So might anyone have an idea on which of the above features may be the most likely culprit?
For example if I remove my use of create methods or extension fields, would that help? (although I really like the extension feature so I would like to still be able to use it)
Would moving extension class fields to the scope of the methods where they are used help?
Elie Richa, Ph.D
Software Engineer, AdaCore
Powered by FUDForum
. Page generated in 0.02042 seconds