Skip to content
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

Should debounce add be a throttle instead? #379

Closed
arj03 opened this issue Aug 3, 2022 · 3 comments
Closed

Should debounce add be a throttle instead? #379

arj03 opened this issue Aug 3, 2022 · 3 comments

Comments

@arj03
Copy link
Member

arj03 commented Aug 3, 2022

While testing the performance of classic vs buttwoo I had to disable the debouncer in db2 because if you do a full sync with the current implementation, then you won't start doing anything with the messages until you get all messages from that feed. If we instead used a throttle, then we would sync every 250ms always. Here is a log from that benchmark if we do a throttle instead:

adding 15k msgs: 3.807s
batching 814
batching 1489
batching 1217
batching 1796
batching 1526
ok 1 wait for replication to complete
after 3000 ms bob has 6842

That 6842 number was around 6200 with addImmediately instead.

The diff to do throttle instead of debounce is 2 lines :-)

@staltz
Copy link
Member

staltz commented Aug 3, 2022

Oh, yes, I support this idea!

@arj03 arj03 mentioned this issue Aug 5, 2022
@staltz
Copy link
Member

staltz commented Aug 23, 2022

Seems done, right?

@staltz staltz closed this as completed Aug 23, 2022
@arj03
Copy link
Member Author

arj03 commented Aug 23, 2022

Right, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants