Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Performance issues when editing/pasting #3889

Closed
ITModernisation opened this issue Feb 5, 2025 · 5 comments
Closed

Performance issues when editing/pasting #3889

ITModernisation opened this issue Feb 5, 2025 · 5 comments
Labels
crash-report Reports of crashes that popped up in IDEA. more-info-needed More information is needed from the person filing the issue.

Comments

@ITModernisation
Copy link

ITModernisation commented Feb 5, 2025

Type of JetBrains IDE (IntelliJ, PyCharm, etc.) and version

IntelliJ IDEA 2024.3.2.2 (build IU-243.23654.189)

Operating System

Linux 6.8.0-52-generic (amd64)

TeXiFy IDEA version

0.10.0

Description

We are running a large tex project, containing about 20 main documents, each composed of numerous sub-odinate tex files, with many listings, images and so forth.

  1. the good news first: your plugin is fabulous! It is a perfect assistant for my daily work, which is designing and maintaining our products using LaTex with lots of packages and self developed macros.
  2. problem #1 is the fact that soon after starting my intelliJ/tex project, my machine starts humming like it does when it is indexing. But: it never stops doing it. The machine keeps humming without interruption, even if I don't touch the keyboard. This decreases performance significantly. At times intelliJ informs me that your plugin decreases performance and asks if I want to disable it.
  3. problem # 2 is the fact that an EDIT-PASTE into a tex file leads to a total disruption of my work. Nothing goes, the intelliJ workbench is halted for a minute or so. This happems also when I am inserting a new-line charcter. When I PASTE being in the COLUMN MODE this does NOT happen! But it is very awkward to constantly switch between the two editing modes.

If you need any further information please let me know or call me.

Thanks a lot in advance
Ernst Fabel
+49 160 228 7159

Stacktrace

java.lang.Exception
	at com.intellij.psi.stubs.StubTreeLoaderImpl.diagnoseLengthMismatch(StubTreeLoaderImpl.java:195)
	at com.intellij.psi.stubs.StubTreeLoaderImpl.checkLengthMatch(StubTreeLoaderImpl.java:151)
	at com.intellij.psi.stubs.StubTreeLoaderImpl.readFromVFile(StubTreeLoaderImpl.java:118)
	at com.intellij.psi.stubs.StubTreeLoader$StubTreeAndIndexUnmatchCoarseException.doCreateCompleteException(StubTreeLoader.java:200)
	at com.intellij.psi.stubs.StubTreeLoader$StubTreeAndIndexUnmatchCoarseException.lambda$createCompleteException$0(StubTreeLoader.java:194)
	at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:749)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:705)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$computeInNonCancelableSection$4(CoreProgressManager.java:291)
	at com.intellij.openapi.progress.Cancellation.computeInNonCancelableSection(Cancellation.java:114)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computeInNonCancelableSection(CoreProgressManager.java:291)
	at com.intellij.psi.stubs.StubTreeLoader$StubTreeAndIndexUnmatchCoarseException.createCompleteException(StubTreeLoader.java:193)
	at com.intellij.psi.impl.source.PsiFileImpl.loadTreeElement(PsiFileImpl.java:242)
	at com.intellij.psi.impl.source.PsiFileImpl.calcTreeElement(PsiFileImpl.java:826)
	at com.intellij.extapi.psi.StubBasedPsiElementBase.getNode(StubBasedPsiElementBase.java:127)
	at com.intellij.extapi.psi.ASTDelegatePsiElement.getFirstChild(ASTDelegatePsiElement.java:89)
	at com.intellij.psi.util.PsiTreeUtil.getChildrenOfTypeAsList(PsiTreeUtil.java:413)
	at nl.hannahsten.texifyidea.psi.impl.LatexCommandsImpl.getParameterList(LatexCommandsImpl.java:38)
	at nl.hannahsten.texifyidea.util.parser.LatexCommandsUtilKt.requiredParameters(LatexCommandsUtil.kt:200)
	at nl.hannahsten.texifyidea.util.parser.LatexCommandsUtilKt.forcedFirstRequiredParameterAsCommand(LatexCommandsUtil.kt:215)
	at nl.hannahsten.texifyidea.util.parser.LatexCommandsUtilKt.definitionCommand(LatexCommandsUtil.kt:73)
	at nl.hannahsten.texifyidea.util.parser.LatexCommandsUtilKt.definedCommandName(LatexCommandsUtil.kt:78)
	at nl.hannahsten.texifyidea.highlighting.LatexAnnotator.annotateCommands(LatexAnnotator.kt:209)
	at nl.hannahsten.texifyidea.highlighting.LatexAnnotator.annotate(LatexAnnotator.kt:71)
	at com.intellij.codeInsight.daemon.impl.AnnotationHolderImpl.runAnnotatorWithContext(AnnotationHolderImpl.java:218)
	at com.intellij.codeInsight.daemon.impl.AnnotatorRunner.lambda$runAnnotator$2(AnnotatorRunner.java:130)
	at com.intellij.codeInsight.daemon.impl.AnnotationSessionImpl.computeWithSession(AnnotationSessionImpl.java:87)
	at com.intellij.codeInsight.daemon.impl.AnnotatorRunner.runAnnotator(AnnotatorRunner.java:120)
	at com.intellij.codeInsight.daemon.impl.AnnotatorRunner.lambda$runAnnotatorsAsync$0(AnnotatorRunner.java:67)
	at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.tryRunReadAction(AnyThreadWriteThreadingSupport.kt:333)
	at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:972)
	at com.intellij.codeInsight.daemon.impl.AnnotatorRunner.lambda$runAnnotatorsAsync$1(AnnotatorRunner.java:67)
	at com.intellij.concurrency.ApplierCompleter.processArrayItem(ApplierCompleter.java:126)
	at com.intellij.concurrency.ApplierCompleter.processArray(ApplierCompleter.java:207)
	at com.intellij.concurrency.ApplierCompleter.execAll(ApplierCompleter.java:176)
	at com.intellij.concurrency.ApplierCompleter.lambda$exec$0(ApplierCompleter.java:115)
	at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.tryRunReadAction(AnyThreadWriteThreadingSupport.kt:351)
	at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:972)
	at com.intellij.concurrency.ApplierCompleter.lambda$wrapInReadActionAndIndicator$2(ApplierCompleter.java:158)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$14(CoreProgressManager.java:674)
	at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:749)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:705)
	at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:673)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:79)
	at com.intellij.concurrency.ApplierCompleter.wrapInReadActionAndIndicator(ApplierCompleter.java:169)
	at com.intellij.concurrency.ApplierCompleter.lambda$wrapAndRun$1(ApplierCompleter.java:150)
	at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.executeByImpatientReader(AnyThreadWriteThreadingSupport.kt:544)
	at com.intellij.openapi.application.impl.ApplicationImpl.executeByImpatientReader(ApplicationImpl.java:176)
	at com.intellij.concurrency.ApplierCompleter.wrapAndRun(ApplierCompleter.java:150)
	at com.intellij.concurrency.ApplierCompleter.exec(ApplierCompleter.java:118)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:507)
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1491)
	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:2073)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:2035)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:187)

@ITModernisation ITModernisation added crash-report Reports of crashes that popped up in IDEA. untriaged Issue type still needs to be triaged or verified. labels Feb 5, 2025
@PHPirates
Copy link
Collaborator

PHPirates commented Feb 6, 2025

Hi, thanks for reaching out. How many files and lines of code are we talking about? You can see this for example with the statistic plugin if you add tex as an extension.
I cannot reproduce any performance issues with a project with 250 LaTeX files with total 12k lines.

If you could create a profiling snapshot as described in
https://hannah-sten.github.io/TeXiFy-IDEA/troubleshooting.html#debugging-performance-issues
then that should directly pinpoint the source of the performance issues.

I'm not quite sure if the high CPU usage and the UI freeze are the same problem, so separate snapshots would be helpful.
(The exception is unrelated)

@ITModernisation
Copy link
Author

Image

This is the file statistics covering the total tex project.
More will follow ...

@PHPirates PHPirates changed the title java.lang.Exception Performance issues when editing/pasting Feb 7, 2025
@PHPirates
Copy link
Collaborator

@ITModernisation As found in #3893, some of this could be caused by the "package not installed" inspection, please try disabling it

@PHPirates PHPirates added more-info-needed More information is needed from the person filing the issue. and removed untriaged Issue type still needs to be triaged or verified. labels Feb 7, 2025
@ITModernisation
Copy link
Author

This is not a "package inspection" or caching or something else inspection. Anyway, we can not work with this, so we decided to uninstall your plugin.

@PHPirates
Copy link
Collaborator

Alright, I will close this issue then. If you ever have more information to help me reproduce and fix the issue, please reopen and I will look into it.

@PHPirates PHPirates closed this as not planned Won't fix, can't repro, duplicate, stale Feb 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
crash-report Reports of crashes that popped up in IDEA. more-info-needed More information is needed from the person filing the issue.
Projects
None yet
Development

No branches or pull requests

2 participants