-
-
Notifications
You must be signed in to change notification settings - Fork 570
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
Poor performance of long typing animation #820
Comments
|
can any one suggest me a work around for this? |
@Pratyush-Nirwan there are no solution to fix the issue yet, sorry. Unless you can use smaller strings. |
ohh thats sad |
Just realized that maybe I can split a long string into chunks (lines) and process them one by one. It will speed up the animation. |
This is a difficult problem, the typing animation already uses partition to split the string into characters with optional formatting. But the draw prompt function (in cmd plugin) calls split_equal on each string (on each added character) and the longer the string the slowest the call. On my machine with ~3000 characters, it took about 50ms which is a lot of you have an animation with 0 delays. I've optimized split_equal a bit, but this doesn't make much difference. The only solution I see is to add some method to CMD plugin to allow to add of a single character to the prompt, this will make it possible to ignore the whole |
Now the lines are split and printed individually on the terminal. This improves the performance of long animations. But still, it slows down when using I leave this open maybe I will come up to speed this even further. |
Issue summary
The longer the animation the slower it become
Expected behavior
The animation should be fast no matter how long, if using 0 as delay
Actual behavior
Animation slows down
Steps to reproduce
echo result["def"]
withecho* result["def"], 0
Additional notes
There is a need for some kind of optimization the longer function is split_equal that needs to be executed on each interval.
A possible solution is using an array as a prompt, and the CMD will assume that it's already partitioned and it may be faster to process since you will not need to use interate_formatting.
The text was updated successfully, but these errors were encountered: