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

Zigbrain slows down the intellij terminal #91

Closed
borissmidt opened this issue Jan 12, 2025 · 3 comments
Closed

Zigbrain slows down the intellij terminal #91

borissmidt opened this issue Jan 12, 2025 · 3 comments
Labels
bug Something isn't working

Comments

@borissmidt
Copy link

borissmidt commented Jan 12, 2025

Dear,

After profiling my IDE i've noticed that ZigBrains slows down the terminal.
It seems every call to jediterm.ProcessChar ends up as a call to:

override fun applyFilter(line: String, entireLength: Int): Filter.Result? {

To profile this issue, i catted a long file and ran the async profiler it also seems that because the file has many lines like :01:14:27,570 it triggers the findLongestParseablePathFromOffset which then always fails on the file exists.

Maybe it could be useful the file.NonExists seems to be the slowest.

profile.zip

It might be better to work like the intellij plugin of the console and highlight it even if it isn't an existing file.
The user will than get a false positive underlining without any real disadvantage.

@FalsePattern FalsePattern added the bug Something isn't working label Jan 12, 2025
@borissmidt
Copy link
Author

I tried it with another file and then the performance is less affected it still contributes to 4% of the cpu usage.
But maybe there is just a bigger issue with the design of the terminal itself that it works on a per character level.
So it makes way to many calls to the filter.

@FalsePattern
Copy link
Owner

FalsePattern commented Jan 12, 2025

Fixed in 20.1.2

I also did some before/after low-precision profiles when doing cat Down_House_2001_eng.srt in the terminal:

Before:
2025-01-12 14_19_06-+0100

After:
2025-01-12 14_34_29-+0100

@borissmidt
Copy link
Author

Cool, i've also spend some time for this one:

I suspect because the build interminal passes one character at a time it really calls these code path too often. I think it xan be resolved by passing a buffer in one go.

So i opened an issue here about it and i'll see how they will respond.
JetBrains/jediterm#294

Tanks again for resolving this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants