auto_refresh=False
is slower than auto_refresh=True
#2432
Unanswered
akihironitta
asked this question in
Q&A
Replies: 1 comment 1 reply
-
Auto refresh will perform a refresh 10 times a second no matter the workload, which will have a minimal impact on performance. If you don't use auto refresh and/or call refresh manually then you risk spending too much time rendering progress bars if you call it many times a second. Your example code isn't the best at benchmarking, since sleeps aren't accurate. Try removing the sleep and changing the range to a million. In general, there are few reasons to disable auto refresh. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Question
auto_refresh=False
is slower thanauto_refresh=True
? If so,auto_refresh=False
slower thanauto_refresh=True
?(related to #1536)
Possible cause
Digging into the rich codebase has made me think that it's because, with
auto_refresh=True
, there's a dedicated thread updating the progress bar while, withauto_refresh=False
, the main thread updates the progress bar.Do you think my guess is right? or are there any factors that slows down speed?
To reproduce
Here's my script which should have same number of "updates" (i.e., an update should occurs 10 times per second) in both cases. It would be great if you could tell if it's (in)appropriate for benchmarking speed between
auto_refresh=True|False
fairly.Click to expand: code and output
Click to expand: platform
Background
We're trying to debug slowdown in rich integration in our project (Lightning-AI/pytorch-lightning#13937), and git bisecting has led me to one of the changes made to the rich integration component (Lightning-AI/pytorch-lightning@137b62d).
P.S. Thank you for your wonderful work on this project!
Beta Was this translation helpful? Give feedback.
All reactions