Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Matrix
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container Registry
Model registry
Operate
Environments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TeDomum
Matrix
Commits
5645d974
Commit
5645d974
authored
9 years ago
by
David Baker
Browse files
Options
Downloads
Patches
Plain Diff
Add some comments to areas that could be optimised.
parent
3fbb0317
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
synapse/handlers/sync.py
+3
-0
3 additions, 0 deletions
synapse/handlers/sync.py
synapse/push/__init__.py
+3
-1
3 additions, 1 deletion
synapse/push/__init__.py
synapse/push/bulk_push_rule_evaluator.py
+8
-0
8 additions, 0 deletions
synapse/push/bulk_push_rule_evaluator.py
with
14 additions
and
1 deletion
synapse/handlers/sync.py
+
3
−
0
View file @
5645d974
...
...
@@ -447,6 +447,9 @@ class SyncHandler(BaseHandler):
)
now_token
=
now_token
.
copy_and_replace
(
"
presence_key
"
,
presence_key
)
# We now fetch all ephemeral events for this room in order to get
# this users current read receipt. This could almost certainly be
# optimised.
_
,
all_ephemeral_by_room
=
yield
self
.
ephemeral_by_room
(
sync_config
,
now_token
)
...
...
This diff is collapsed.
Click to expand it.
synapse/push/__init__.py
+
3
−
1
View file @
5645d974
...
...
@@ -26,7 +26,9 @@ import random
logger
=
logging
.
getLogger
(
__name__
)
# Pushers could now be moved to pull out of the event_actions table instead
# of listening on the event stream: this would avoid them having to run the
# rules again.
class
Pusher
(
object
):
INITIAL_BACKOFF
=
1000
MAX_BACKOFF
=
60
*
60
*
1000
...
...
This diff is collapsed.
Click to expand it.
synapse/push/bulk_push_rule_evaluator.py
+
8
−
0
View file @
5645d974
...
...
@@ -59,6 +59,14 @@ def evaluator_for_room_id(room_id, hs, store):
class
BulkPushRuleEvaluator
:
"""
Runs push rules for all users in a room.
This is faster than running PushRuleEvaluator for each user because it
fetches all the rules for all the users in one (batched) db query
rarher than doing multiple queries per-user. It currently uses
the same logic to run the actual rules, but could be optimised further
(see https://matrix.org/jira/browse/SYN-562)
"""
def
__init__
(
self
,
room_id
,
rules_by_user
,
display_names
,
users_in_room
):
self
.
room_id
=
room_id
self
.
rules_by_user
=
rules_by_user
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment