-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
[Improvement] progress.track is relatively slow #176
Comments
Hi Kent, Interesting. If you set I suspect tqdm is monitoring how long things are taking and adapting the rendering accordingly. Rich progress bars probably are slower, it is generating color codes and its built on a multi-purpose rendering engine. Whereas tqdm has one job. There's probably a few more optimizations I could make, but frankly its not going to make a difference in a real world task. In your example it takes 3930 milliseconds to do 1 million iterations. That means it will add an overhead of 0.004 milliseconds each iteration, which will likely be a tiny fraction of whatever work is done inside the loop. The difference is only going to be significant if your loop is doing virtually nothing... |
Try v4.1.0, it uses a different strategy for very quick iterations. I'm pretty sure tqdm is doing something similar. |
Hi, I only just checked this, but they're now about the same speed. Thanks @willmcgugan! |
Description
I really like the look and feel of rich. One thing that stops me using it more is that
rich.progress.track
is slow compared totqdm.tqdm
To Reproduce
Produces
Versions etc
Thanks!
Kent
The text was updated successfully, but these errors were encountered: