-
Notifications
You must be signed in to change notification settings - Fork 377
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
parallelize broadcast room join #5717
parallelize broadcast room join #5717
Conversation
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.
LGTM.
One suggestion and two typos.
64ecd03
to
84ad72d
Compare
Codecov Report
@@ Coverage Diff @@
## develop #5717 +/- ##
==========================================
Coverage ? 78.64%
==========================================
Files ? 133
Lines ? 15315
Branches ? 2338
==========================================
Hits ? 12045
Misses ? 2585
Partials ? 685
Continue to review full report at Codecov.
|
84ad72d
to
e944443
Compare
78275d7
to
6fa53f1
Compare
we should think about if this is still necessary once #5892 is merged |
What needs to be done here? Fix the test or answering Fred's comment? |
This morning I analyzed if it is useful to still parallelize Some facts that should help us decide:
I did a little run to compare the blocking joins and parallel joins. The results are the following:
IMO The results make sense since one join contains of two API calls which took me roughly 0.3 to 0.5 seconds each. This counts up to ~0.8 seconds for each join. These numbers are reflected in the ASYNC time result since all 3 rooms are joined in parallel. The blocking time result is roughly a factor 3 which is due to the fact that we have 3 broadcast rooms to join. Since the whole complexity of joining broadcast rooms is separated from the sync processes since #5931 and we can establish the broadcast room join before even calling the first sync the time consumption is not that big of a deal IMO. But saving 1.5 s at startup is still a nice goodie. Because of that, I would opt for implementing this feature since it already has a PR. |
6fa53f1
to
b7d467a
Compare
39513ac
to
45351ce
Compare
Join all broadcast rooms in parallel
45351ce
to
6f91485
Compare
@@ -104,21 +104,22 @@ def update_local_aliases(self) -> bool: | |||
""" | |||
server_name = urlparse(self.client.api.base_url).netloc | |||
changed = False | |||
for event_type in ["m.room.aliases", "m.room.canonical_alias"]: |
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.
why don't we need the canonical aliases anymore?
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.
we don't use them anymore
if "alias" in response: | ||
if self.canonical_alias != response["alias"]: | ||
self.canonical_alias = response["alias"] | ||
changed = True | ||
if changed and self.aliases and not self.canonical_alias: |
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.
Is it possible for a room to not have a canonical alias?
"sync thread, since that is necessary to properly generate the " | ||
"filters." | ||
) | ||
assert self._broadcast_rooms, msg |
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.
is this right? do we join the broadcast rooms if the node is not configured to use the ms and pfs?
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.
We will always join at least the discovery
room.
Joining rooms is a bit slow, this parallelizes it, should make the first run a tidy bit faster (roughly 10 seconds).
This also moves the sync code to a separate init function with explicit assumption checks.