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

Improve inspections CPU usage #3061

Closed
Rixtho opened this issue May 2, 2023 · 8 comments
Closed

Improve inspections CPU usage #3061

Rixtho opened this issue May 2, 2023 · 8 comments
Labels
enhancement New feature or (non bug related) change to the program.

Comments

@Rixtho
Copy link

Rixtho commented May 2, 2023

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

IntelliJ Ultimate 2023.1

Operating System

Windows 11 Pro 22H2

TeXiFy IDEA version

0.7.29

Steps to reproduce

Opening the project results in high CPU usage (double or triple of usual usage). Additionally, this also happens while working on the project. I noticed that it is more noticeable when there are more files in the project.

Minimal example to reproduce the problem

Already creating a new empty LaTeX project with the new project window uses more CPU than empty Java projects, for example. As I mentioned, it seems that it is linked to the number of files in the project. The issue still exists when IntelliJ is in power save mode.
snapshot.zip

@Rixtho Rixtho added bug Deficiencies in TeXiFy behaviour. untriaged Issue type still needs to be triaged or verified. labels May 2, 2023
@PHPirates
Copy link
Collaborator

Thanks for the snapshot, I'll have a look.

@PHPirates
Copy link
Collaborator

PHPirates commented May 3, 2023

I don't see anything strange, could you clarify in more detail what happens when you are doing what? You talk about opening a project, creating a project, and working on the project, but these are all very different things.

This is what I found:

  • Open a project with 100 files, 6000 lines (on Windows with MiKTeX)
  • Wait a bit until indexing and inspections are done
  • When idle, intellij uses about 1% cpu
  • When typing LaTeX, CPU usage up to 50-60%. I snapshotted this and it's all inspections, so nothing out of the ordinary (though this could certainly be improved).

It might be I missed something, could you apply this filter in visualvm before running a sample?

image

@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 May 3, 2023
@Rixtho
Copy link
Author

Rixtho commented May 3, 2023

If CPU usage up to 50-60% is expected then everything working fine. I thought this was a bug on my end because I don't have this issue with large Java projects.

@PHPirates
Copy link
Collaborator

PHPirates commented May 3, 2023

Yeah I don't know how they manage to do that, but we can have another look for general performance improvements.

Note to self: check if indexSinkOccurrence has performance implications

@PHPirates PHPirates added enhancement New feature or (non bug related) change to the program. and removed more-info-needed More information is needed from the person filing the issue. bug Deficiencies in TeXiFy behaviour. labels May 3, 2023
@PHPirates PHPirates changed the title Periodic high CPU usage Improve inspections CPU usage May 3, 2023
@PHPirates
Copy link
Collaborator

#3147 partially fixes this, but not completely.
You can already try https://plugins.jetbrains.com/plugin/download?rel=true&updateId=357446

@SaeidYazdani
Copy link

Hi, I wanted to open a new ticket but saw this one.

I have recently updated to 0.7.32 release and IDEA 2023.1.4. I can barely work on my latex Project as it has become extremely slow! when I type a couple of characters it stops responding for 5 to 10 seconds... I have disabled all the language and latex inspections but still have the problem. Also I noticed this happens when I do ctrl+space and want to browse for a file for a figure (autocomplete for file names),

I have tried to downgrade my Intellij IDEA to older version but the problem exists.

I have no idea how to gather some usefull report for you guys...

The only thing that works normal still is building the project. So I guess it has something to do with your plugin.

Any idea how can I down grade to an older plugin to check?

Mind you I am using an intel core i9 13900k at 6GHz and 64GB ram

@PHPirates
Copy link
Collaborator

That does sounds like a different issue than this one, but to be sure, it would be really helpful if you could upload a visualvm snapshot as described here: https://hannah-sten.github.io/TeXiFy-IDEA/troubleshooting.html#debugging-performance-issues
You can download older versions here: https://plugins.jetbrains.com/plugin/9473-texify-idea/versions

@PHPirates
Copy link
Collaborator

I believe this was fixed by #3147

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or (non bug related) change to the program.
Projects
None yet
Development

No branches or pull requests

3 participants