From e8915b1b288dcda3369f8ddc03a42b8f7f1bb941 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Mon, 2 May 2022 20:25:57 -0700 Subject: [PATCH] ircd::m::homeserver: Bootstrap tweaks. --- matrix/homeserver_bootstrap.cc | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/matrix/homeserver_bootstrap.cc b/matrix/homeserver_bootstrap.cc index eecfc598b..6e890de92 100644 --- a/matrix/homeserver_bootstrap.cc +++ b/matrix/homeserver_bootstrap.cc @@ -202,6 +202,7 @@ try fs::map::opts map_opts(fileopts); map_opts.sequential = true; map_opts.huge2mb = true; + map_opts.huge1gb = true; const fs::map map { file, map_opts @@ -317,8 +318,6 @@ try count += i; - auto opts(map_opts); - opts.offset = ebytes[0]; const size_t incore { ebytes[1] > ebytes[0]? @@ -327,7 +326,9 @@ try }; // advise dontneed - ebytes[0] += evict(map, incore, opts); + if(likely(!validate_json_only)) + ebytes[0] += evict(map, incore, ebytes[0]); + if(count % (batch_max * 256) != 0) continue; @@ -338,7 +339,7 @@ try const auto elapsed { - stopwatch.at().count() + stopwatch.at().count() }; log::info @@ -349,12 +350,14 @@ try eval.faulted, pretty(pbuf[0], iec(ebytes[1])), stopwatch.pretty(pbuf[1]), - (count / std::max(elapsed, 1L)), - pretty(pbuf[2], iec(ebytes[1] / std::max(elapsed, 1L)), 1), - pretty(pbuf[3], iec(db_bytes / std::max(elapsed, 1L)), 1), + (count / std::max(elapsed, 1L)) * 1000, + pretty(pbuf[2], iec((ebytes[1] / std::max(elapsed, 1L)) * 1000), 1), + pretty(pbuf[3], iec((db_bytes / std::max(elapsed, 1L)) * 1000), 1), }; - ctx::yield(); + if(likely(!validate_json_only)) + ctx::yield(); + ctx::interruption_point(); } catch(const json::parse_error &e)