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
OPT: Rate limit result suppression message update #5060
Conversation
Updating it for each result is the cause of the slow-down reported in datalad#4868 (comment) With this change we only update at max 2Hz. For the original scenario this results in a ~30% speed-up: ``` datalad subdatasets -d . 4.30s user 1.99s system 101% cpu 6.225 total datalad subdatasets -d . 6.33s user 2.27s system 100% cpu 8.538 total ```
@@ -514,16 +515,24 @@ def default_result_renderer(res): | |||
if res.get('message', None) else '')) | |||
|
|||
|
|||
def _display_suppressed_message(nsimilar, ndisplayed, final=False): | |||
def _display_suppressed_message(nsimilar, ndisplayed, last_ts, final=False): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This direction sounds good to me, but I guess that the rate-limiting shouldn't be in effect when final=True
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point! Adjusted, thx.
Codecov Report
@@ Coverage Diff @@
## maint #5060 +/- ##
=======================================
Coverage 89.96% 89.96%
=======================================
Files 292 292
Lines 40863 40875 +12
=======================================
+ Hits 36761 36774 +13
+ Misses 4102 4101 -1
Continue to review full report at Codecov.
|
Co-authored-by: Yaroslav Halchenko <debian@onerussian.com>
Even if it is triggered faster than the rate limit.
Updating it for each result is the cause of the slow-down reported in
#4868 (comment)
With this change we only update at max 2Hz. For the original scenario
this results in a ~30% speed-up: