-
-
Notifications
You must be signed in to change notification settings - Fork 120
perf: batched event reception #7825
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
base: main
Are you sure you want to change the base?
Conversation
1ea223a to
ec7b44a
Compare
|
I have tested it on desktop, it works, events are frequently batched into 3 or 5 events for a single call. But no idea on actual impact on the performance, did not measure anything. |
|
I could not perform the tests under the same conditions so far, because we have some hacky event logging there, which doesn't work with this new JSON-RPC method. However, the delay is down to ~150ms without any logging (compared to ~1300ms in my MR). I will try to fix the logging and then re-do the measurements. |
|
OK, I have fixed backend logging on DC Desktop and performed another 150 measurements on this patch. The average is For good measure, I also re-measured the delay with the old non-batch API, but without backend logging, and got I also tested this MR without backend logging, and the delay is at blazing So, no matter if logging is on or off, this is an improvement! |
WofWca
left a comment
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.
So this is technically not a breaking change, but, since DC Desktop is using some hacks, it would need to get adjusted. Anyways, I already have the code ready for that.
I didn't look to closely at the Rust part of the code, but it looks sane, and seems to work. The JS code looks trivial.
Regarding this: I think I could make an MR that adds support for this batch API, before this Core MR is merged, so as to not get other devs who always use latest core with latest desktop angry. |
ec7b44a to
129ea2d
Compare
|
I added doc comment and limited the number of returned events to 100 per batch. It is unlikely ever at 100 events, just to have some limit on memory usage. |
See chatmail/core#7825. This MR ensures that we properly handle events even when they are retrieved with the new `getNextEventBatch()` Core API, which is going to begin being the case when that MR is merged.
Alternative to #7795