Community
Participate
Working Groups
Checking spelling is a useful but secondary editor activity that IMHO should avoid degrading primary activities. The stack trace below shows spelling being checked synchronously on the main thread delaying editor start up. Surely spelling should be checked on a worker thread that determines the annotations to apply, then invokes a single modify operation to erase stale annotations and apply new ones, possibly suppressing the application of new annotations if the editor view has advanced sufficiently to render the new annotations stale? Thread [main] (Suspended) owns: LocaleSensitiveSpellDictionary (id=1024) StringCoding.deref(ThreadLocal<SoftReference<T>>) line: 63 StringCoding.encode(String, char[], int, int) line: 330 String.getBytes(String) line: 916 LocaleSensitiveSpellDictionary(AbstractSpellDictionary).hashWord(String) line: 484 LocaleSensitiveSpellDictionary(AbstractSpellDictionary).load(URL) line: 648 LocaleSensitiveSpellDictionary(AbstractSpellDictionary).isCorrect(String) line: 515 DefaultSpellChecker.isCorrect(String) line: 323 DefaultSpellChecker.execute(ISpellEventListener, ISpellCheckIterator) line: 250 TextSpellingEngine.check(IDocument, IRegion[], ISpellChecker, ISpellingProblemCollector, IProgressMonitor) line: 41 TextSpellingEngine(SpellingEngine).check(IDocument, IRegion[], SpellingContext, ISpellingProblemCollector, IProgressMonitor) line: 90 DefaultSpellingEngine.check(IDocument, IRegion[], SpellingContext, ISpellingProblemCollector, IProgressMonitor) line: 75 SpellingService$1.run() line: 104 SafeRunner.run(ISafeRunnable) line: 42 SpellingService.check(IDocument, IRegion[], SpellingContext, ISpellingProblemCollector, IProgressMonitor) line: 109 XtextSpellingReconcileStrategy.reconcile(IRegion) line: 78 XtextSpellingReconcileStrategy(SpellingReconcileStrategy).initialReconcile() line: 169 XtextDocumentReconcileStrategy.initialReconcile() line: 118 XtextReconciler.handleInputDocumentChanged(IDocument, IDocument) line: 264 XtextReconciler$TextInputListener.inputDocumentChanged(IDocument, IDocument) line: 179 XtextSourceViewer(TextViewer).fireInputDocumentChanged(IDocument, IDocument) line: 2889 XtextSourceViewer(TextViewer).setDocument(IDocument) line: 2938 XtextSourceViewer(SourceViewer).setDocument(IDocument, IAnnotationModel, int, int) line: 643 XtextSourceViewer(ProjectionViewer).setDocument(IDocument, IAnnotationModel, int, int) line: 375 XtextSourceViewer(SourceViewer).setDocument(IDocument, IAnnotationModel) line: 591 CompleteOCLEditor(AbstractTextEditor).initializeSourceViewer(IEditorInput) line: 4050 CompleteOCLEditor(AbstractTextEditor).createPartControl(Composite) line: 3578 CompleteOCLEditor(StatusTextEditor).createPartControl(Composite) line: 54 CompleteOCLEditor(AbstractDecoratedTextEditor).createPartControl(Composite) line: 447 CompleteOCLEditor(XtextEditor).createPartControl(Composite) line: 500 CompatibilityEditor(CompatibilityPart).createPartControl(IWorkbenchPart, Composite) line: 149 CompatibilityEditor.createPartControl(IWorkbenchPart, Composite) line: 99 CompatibilityEditor(CompatibilityPart).create() line: 335
A patch is appreciated.
If an Eclipse user exited with a Xtext editor open, then the non-trivial cost of loading the spelling dictionary is incurred during Eclipse startup. MAJOR.
(In reply to Ed Willink from comment #2) > non-trivial cost of loading the spelling dictionary 32 seconds.
It'll certainly speed up the the operation that opens an editor.
(In reply to Ed Willink from comment #3) > 32 seconds. Something wierd with my Eclipse / Windows laptop yesterday. Only takes a second today; still worth off-loading.