-
Notifications
You must be signed in to change notification settings - Fork 180
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
Reduce printing in tight loops #85
base: master
Are you sure you want to change the base?
Conversation
This should also help with #56 |
The latest commits caused a conflict to this PR. However it was incomplete as your change would only run on spinners, not bars. You will need to update |
Updated. afaict all classes inherit from Infinite and there is no overwriting of writeln. In particular, this is the inheritance chain for a bar ChargingBar --> Bar --> Progress --> Infinite . |
Right, but when you submitted your PR, bars where using However there are still a number of issues with your PR:
|
Remove print_dt from __init__ but allow changing it via kwargs.
Regarding your comments:
I've also added changes to force that the last line is printed (ending a bar with 99% would be strange). Thanks for taking the time reviewing this PR :) |
I think it would be better to make |
Printing is slow, which is an issue for big tight loops (~100k items, at 100 items/second).
These changes reduce the printing to, at most, twice per second by default.
Setting print_dt = -1 will preserve the previous behaviour.