summaryrefslogtreecommitdiff
path: root/test/rollback_bench.zig
diff options
context:
space:
mode:
Diffstat (limited to 'test/rollback_bench.zig')
-rw-r--r--test/rollback_bench.zig18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/rollback_bench.zig b/test/rollback_bench.zig
index 38fe011d..0f0c77a4 100644
--- a/test/rollback_bench.zig
+++ b/test/rollback_bench.zig
@@ -158,6 +158,24 @@ pub fn main(init: std.process.Init) !void {
x.* = t1 - t0;
y.* = nowNs() - t1;
}
+ // A join (docs/next-daemon.md, Phase 5 part B notes): the session
+ // dumped at a step boundary, which is what the authority pays, and
+ // the joiner's load of it.
+ var dump: [5]u64 = undefined;
+ var load: [5]u64 = undefined;
+ var dump_len: usize = 0;
+ for (&dump, &load) |*x, *y| {
+ const t0 = nowNs();
+ const bytes = try pardes.dump.dumpBytes(core);
+ const t1 = nowNs();
+ dump_len = bytes.len;
+ const loaded = try pardes.dump.load(gpa, .{ .tty_only = true, .image_allocator = gpa, .pdf_allocator = gpa, .tree_sitter_allocator = gpa, .frame_allocator = gpa }, bytes, null);
+ y.* = nowNs() - t1;
+ x.* = t1 - t0;
+ loaded.deinit();
+ core.gpa.free(bytes);
+ }
+ std.debug.print("{s:<8} join: dump {d:.1} MB in {d:.2} ms (the session's step), load {d:.2} ms (the joiner's)\n", .{ s.name, @as(f64, @floatFromInt(dump_len)) / 1e6, @as(f64, @floatFromInt(median(&dump))) * 1e-6, @as(f64, @floatFromInt(median(&load))) * 1e-6 });
var panes: usize = 0;
for (core.panes) |slot| panes += @intFromBool(slot != null);
const ms = 1e-6;