You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I wondered why the intellij terminal was slow and did some simple profiling by running a cat in a loop to just have a lot of characters printed to the terminal.
I tried to make it faster by passing a single string builder in tot 'collect' the result that didn't really help.
So i just commented it out and suddenly the terminal was 2x faster as a result. But i don't see it being used in intellij itself so this can be ignored.
Another change i've found that makes quite a lot of impact is to increase the read buffer size to 4096 and to read a bigger chunk in one go:
With a debugger i found out that this wasn't working that well unless i update the control character check to ignore tabs and end line characters otherwise the buffer is almost completely empty this would also trigger the process hyperlinks less which is quite expensive because of the regex usage.
I'm not sure how much impact these changes would have inside intellij itself since there seem to be quite a lot of hooks where many coroutines are started. So probably some performance can be won there as well.
It really is a very simple test so maybe it can be best to add this to the 'performance' benchmarks for the future.
Essentially i run a 1000 cats of a a rather big file.
Dear,
I wondered why the intellij terminal was slow and did some simple profiling by running a cat in a loop to just have a lot of characters printed to the terminal.
A great amout of impact seems to come from the state that is tracked on each read:
https://github.com/JetBrains/jediterm/blame/70b67201b180440814150d498edf55ab87caf075/JediTerm/src/main/kotlin/com/jediterm/app/JediTermMain.kt#L118-L129
I tried to make it faster by passing a single string builder in tot 'collect' the result that didn't really help.
So i just commented it out and suddenly the terminal was 2x faster as a result. But i don't see it being used in intellij itself so this can be ignored.
Another change i've found that makes quite a lot of impact is to increase the read buffer size to 4096 and to read a bigger chunk in one go:
in
DataStreamIteratingEmulator
With a debugger i found out that this wasn't working that well unless i update the control character check to ignore tabs and end line characters otherwise the buffer is almost completely empty this would also trigger the process hyperlinks less which is quite expensive because of the regex usage.
I'm not sure how much impact these changes would have inside intellij itself since there seem to be quite a lot of hooks where many coroutines are started. So probably some performance can be won there as well.
It really is a very simple test so maybe it can be best to add this to the 'performance' benchmarks for the future.
Essentially i run a 1000 cats of a a rather big file.
As a comparison with my changes it can run in 5s while the main branch terminal does it in 46s.
The text was updated successfully, but these errors were encountered: