perf: precompute the room notification modes if and only if push rules have changed
The room notification modes will only change when the push rules have
changed; otherwise, recomputing them is a no-op, and only wastes time.
Here's a distribution of the worst processing times under this method,
as measured in multiverse with my personal account running (fresh, i.e.
after an initial response) for a few minutes:
Before:
0.001358279s
0.019668889s
0.030104444s
0.030376296s
0.048609819s
0.049683619s
0.054289813s
0.063690030s
After:
0.000000385s
0.000000387s
0.000000410s
0.000000430s
0.000000438s
0.000000478s
0.000000487s
0.000000568s
0.010011267s
The new distribution makes sense: the push rules event comes only once,
in the initial response, so they're processed only once. Then, there's
no need to process it ever again (in my session I've never changed the
processing times), so it's almost instantaneous the subsequent times.
e20bdcd
10 days ago
by bnjbvr
-0.25%
fixup! perf: precompute the room notification modes if and only if push rules have changed