Editing sources is very slow
已回答
I have a C++ application which is about 5 c++ files, and 5 header files. For a total of about 5000 lines of source, a small application. But typing in the code editor is very very slow. New line or inserting any character can take > 1 second.
Is that normal ? I've increased the size of the Java heap from 2G to 6G, but still no better result.
请先登录再写评论。
Oh, and I forgot to mention that I am running in Low Power mode, because the normal mode, was far worst.
When I have a chance to get a stack dump, I always see that thread which seems to be responsible for the slowdown.
"AWT-EventQueue-0 2017.2.1#CL-172.3544.40 CLion, eap:false, os:Mac OS X 10.12.6, java-version:JetBrains s.r.o 1.8.0_152-release-915-b6" #27 prio=6 os_prio=31 tid=0x00007fa905a8b000 nid=0x10903 runnable [0x000070001183d000]
java.lang.Thread.State: RUNNABLE
at com.intellij.psi.impl.source.tree.RecursiveTreeElementWalkingVisitor$ASTTreeGuide.getNextSibling(RecursiveTreeElementWalkingVisitor.java:37)
at com.intellij.psi.impl.source.tree.RecursiveTreeElementWalkingVisitor$ASTTreeGuide.getNextSibling(RecursiveTreeElementWalkingVisitor.java:34)
at com.intellij.util.WalkingState.walkChildren(WalkingState.java:66)
at com.intellij.util.WalkingState.elementStarted(WalkingState.java:52)
at com.intellij.psi.impl.source.tree.RecursiveTreeElementWalkingVisitor.visitNode(RecursiveTreeElementWalkingVisitor.java:85)
at com.intellij.psi.impl.source.tree.RecursiveTreeElementWalkingVisitor.visitComposite(RecursiveTreeElementWalkingVisitor.java:80)
at com.intellij.psi.impl.source.tree.AstBufferUtil$BufferVisitor.visitComposite(AstBufferUtil.java:115)
at com.intellij.psi.impl.source.tree.CompositeElement.acceptTree(CompositeElement.java:148)
at com.intellij.psi.impl.source.tree.AstBufferUtil.toBuffer(AstBufferUtil.java:40)
at com.intellij.psi.impl.source.tree.AstBufferUtil.toBuffer(AstBufferUtil.java:35)
at com.intellij.psi.impl.source.tree.CompositeElement.textToCharArray(CompositeElement.java:279)
at com.intellij.psi.impl.source.tree.CompositeElement.getText(CompositeElement.java:243)
at com.intellij.psi.impl.source.tree.LazyParseableElement.getText(LazyParseableElement.java:97)
at com.intellij.psi.SingleRootFileViewProvider$PsiFileContent.a(SingleRootFileViewProvider.java:654)
at com.intellij.psi.SingleRootFileViewProvider$PsiFileContent$$Lambda$1918/919643798.compute(Unknown Source)
at com.intellij.openapi.application.ReadAction.compute(ReadAction.java:47)
at com.intellij.psi.SingleRootFileViewProvider$PsiFileContent.getText(SingleRootFileViewProvider.java:654)
at com.intellij.psi.SingleRootFileViewProvider.getContents(SingleRootFileViewProvider.java:423)
at com.intellij.psi.impl.source.PsiFileImpl.getText(PsiFileImpl.java:372)
at com.jetbrains.cidr.lang.symbols.symtable.OCSymbolTableProvider.calcTableUsingPSI(OCSymbolTableProvider.java:85)
at com.jetbrains.cidr.lang.symbols.symtable.OCSymbolTableProvider.calcTableUsingPSI(OCSymbolTableProvider.java:26)
at com.jetbrains.cidr.lang.symbols.symtable.FileSymbolTablesCache.calcTableUsingPSI(FileSymbolTablesCache.java:339)
at com.jetbrains.cidr.lang.parser.OCParser.evaluatePartialContext(OCParser.java:279)
at com.jetbrains.cidr.lang.parser.OCLazyBlockStatementElementType.isParsable(OCLazyBlockStatementElementType.java:52)
- locked <0x00000006545a10c0> (a com.jetbrains.cidr.lang.psi.impl.OCFileImpl)
at com.intellij.psi.impl.source.text.BlockSupportImpl.findReparseableRoots(BlockSupportImpl.java:135)
at com.intellij.psi.impl.source.text.BlockSupportImpl.reparseRange(BlockSupportImpl.java:89)
at com.intellij.psi.impl.DocumentCommitThread.doCommit(DocumentCommitThread.java:752)
at com.intellij.psi.impl.DocumentCommitThread.lambda$commitUnderProgress$4(DocumentCommitThread.java:533)
at com.intellij.psi.impl.DocumentCommitThread$$Lambda$1763/1832215314.run(Unknown Source)
at com.intellij.psi.impl.DocumentCommitThread.commitUnderProgress(DocumentCommitThread.java:556)
at com.intellij.psi.impl.DocumentCommitThread.commitSynchronously(DocumentCommitThread.java:452)
at com.intellij.psi.impl.PsiDocumentManagerBase.lambda$doCommit$0(PsiDocumentManagerBase.java:453)
at com.intellij.psi.impl.PsiDocumentManagerBase$$Lambda$1762/20364252.run(Unknown Source)
at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:1031)
at com.intellij.psi.impl.PsiDocumentManagerBase.doCommit(PsiDocumentManagerBase.java:465)
at com.intellij.psi.impl.PsiDocumentManagerBase.commitDocument(PsiDocumentManagerBase.java:313)
at com.intellij.psi.impl.source.codeStyle.lineIndent.FormatterBasedLineIndentProvider.getLineIndent(FormatterBasedLineIndentProvider.java:36)
at com.intellij.psi.impl.source.codeStyle.CodeStyleFacadeImpl.getLineIndent(CodeStyleFacadeImpl.java:66)
at com.intellij.codeInsight.editorActions.EnterHandler$DoEnterAction.a(EnterHandler.java:492)
at com.intellij.codeInsight.editorActions.EnterHandler$DoEnterAction.run(EnterHandler.java:440)
at com.intellij.codeInsight.editorActions.EnterHandler.b(EnterHandler.java:171)
at com.intellij.codeInsight.editorActions.EnterHandler.a(EnterHandler.java:81)
at com.intellij.codeInsight.editorActions.EnterHandler$$Lambda$1972/2029251578.run(Unknown Source)
at com.intellij.psi.impl.source.PostprocessReformattingAspect.lambda$disablePostprocessFormattingInside$1(PostprocessReformattingAspect.java:108)
at com.intellij.psi.impl.source.PostprocessReformattingAspect$$Lambda$1755/2065647765.compute(Unknown Source)
at com.intellij.psi.impl.source.PostprocessReformattingAspect.disablePostprocessFormattingInside(PostprocessReformattingAspect.java:116)
at com.intellij.psi.impl.source.PostprocessReformattingAspect.disablePostprocessFormattingInside(PostprocessReformattingAspect.java:107)
at com.intellij.codeInsight.editorActions.EnterHandler.executeWriteAction(EnterHandler.java:80)
at com.intellij.openapi.editor.actionSystem.EditorWriteActionHandler$1.run(EditorWriteActionHandler.java:50)
at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:1031)
at com.intellij.openapi.editor.actionSystem.EditorWriteActionHandler.doExecute(EditorWriteActionHandler.java:63)
at com.intellij.openapi.editor.actionSystem.EditorActionHandler.execute(EditorActionHandler.java:222)
at com.intellij.codeInsight.template.impl.editorActions.EnterHandler.executeWriteAction(EnterHandler.java:49)
at com.intellij.openapi.editor.actionSystem.EditorWriteActionHandler$1.run(EditorWriteActionHandler.java:50)
at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:1031)
at com.intellij.openapi.editor.actionSystem.EditorWriteActionHandler.doExecute(EditorWriteActionHandler.java:63)
at com.intellij.openapi.editor.actionSystem.EditorActionHandler$3$1.perform(EditorActionHandler.java:206)
at com.intellij.openapi.editor.actionSystem.EditorActionHandler.doIfEnabled(EditorActionHandler.java:109)
at com.intellij.openapi.editor.actionSystem.EditorActionHandler.access$000(EditorActionHandler.java:38)
at com.intellij.openapi.editor.actionSystem.EditorActionHandler$3.perform(EditorActionHandler.java:203)
at com.intellij.openapi.editor.impl.CaretModelImpl.a(CaretModelImpl.java:356)
at com.intellij.openapi.editor.impl.CaretModelImpl$$Lambda$1538/1306166376.run(Unknown Source)
at com.intellij.openapi.editor.impl.CaretModelImpl.doWithCaretMerging(CaretModelImpl.java:445)
at com.intellij.openapi.editor.impl.CaretModelImpl.runForEachCaret(CaretModelImpl.java:348)
at com.intellij.openapi.editor.impl.CaretModelImpl.runForEachCaret(CaretModelImpl.java:339)
at com.intellij.openapi.editor.actionSystem.EditorActionHandler.execute(EditorActionHandler.java:200)
at com.jetbrains.cidr.lang.editor.OCSmartCompletionInPlaceholderEnterHandler.executeWriteAction(OCSmartCompletionInPlaceholderEnterHandler.java:83)
at com.intellij.openapi.editor.actionSystem.EditorWriteActionHandler$1.run(EditorWriteActionHandler.java:50)
at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:1031)
at com.intellij.openapi.editor.actionSystem.EditorWriteActionHandler.doExecute(EditorWriteActionHandler.java:63)
at com.intellij.openapi.editor.actionSystem.EditorActionHandler$4.perform(EditorActionHandler.java:217)
at com.intellij.openapi.editor.actionSystem.EditorActionHandler.doIfEnabled(EditorActionHandler.java:109)
at com.intellij.openapi.editor.actionSystem.EditorActionHandler.execute(EditorActionHandler.java:214)
at com.intellij.openapi.editor.actionSystem.EditorAction.lambda$actionPerformed$0(EditorAction.java:98)
at com.intellij.openapi.editor.actionSystem.EditorAction$$Lambda$1652/415152938.run(Unknown Source)
at com.intellij.openapi.command.impl.CoreCommandProcessor.a(CoreCommandProcessor.java:149)
at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:109)
at com.intellij.openapi.editor.actionSystem.EditorAction.actionPerformed(EditorAction.java:107)
at com.intellij.openapi.editor.actionSystem.EditorAction.actionPerformed(EditorAction.java:86)
at com.intellij.openapi.actionSystem.ex.ActionUtil$1.run(ActionUtil.java:216)
at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAware(ActionUtil.java:233)
at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher$1.performAction(IdeKeyEventDispatcher.java:576)
at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.a(IdeKeyEventDispatcher.java:625)
at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher$$Lambda$1394/659076136.run(Unknown Source)
at com.intellij.openapi.application.TransactionGuardImpl.performUserActivity(TransactionGuardImpl.java:193)
at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.processAction(IdeKeyEventDispatcher.java:624)
at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.f(IdeKeyEventDispatcher.java:479)
at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.dispatchKeyEvent(IdeKeyEventDispatcher.java:213)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:621)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:365)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
I've created the issue in our tracker: https://youtrack.jetbrains.com/issue/CPP-10486. Feel free to comment or upvote and sorry for the inconvenience.