From 453748c00ab3db967a9260875dd6728e613d33d4 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Sun, 13 Sep 2020 00:15:44 -0700 Subject: [PATCH] ircd::m::homeserver: Optimize bootstrap eval w/ unique/replays assumptions. --- matrix/homeserver_bootstrap.cc | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/matrix/homeserver_bootstrap.cc b/matrix/homeserver_bootstrap.cc index ac3da5559..a53f616eb 100644 --- a/matrix/homeserver_bootstrap.cc +++ b/matrix/homeserver_bootstrap.cc @@ -258,6 +258,17 @@ try // Sorting may be slow for large inputs; but the alternative may be also... //vmopts.ordered = true; + // Optimize eval if we guarantee there's only one copy of each event + // in the input. This particular option is if we can at least guarantee + // duplicates aren't near each other in the array (there should be no + // duplicates). + vmopts.unique = false; + + // Optimize eval if we guarantee there's only one copy of each event + // in the input. If there are duplicates anywhere in the input they will + // be replayed, which is really bad. + vmopts.replays = true; + // Outputs to infolog for each event; may be noisy; vmopts.infolog_accept = false;