Skip to content

Make routing fast(er) again

Ghost User requested to merge feature-#375-cache-priority into master

Based on !104 (merged), so merge that first.

Routing was very slow because for message ordering, we used a comparator which called expensive functions. I added a cache for that function now, so it doesn't have to be computed multiple times for one sorting.

I also found that the stream functionality was quite slow, so replaced it by an old-fashioned loop.

These changes led to getDeliveryPredictability taking around 3 times the time of getConnections (decreased from about 34 times). I executed until roughly ~1700s with the new config in at most 5h.

If we still find this is too slow, we can think about ordering less by caching the messages to send to each connection for several seconds.

Merge request reports