diff options
Diffstat (limited to 'test/perf.zig')
| -rw-r--r-- | test/perf.zig | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/test/perf.zig b/test/perf.zig index 8e622680..d8025fdc 100644 --- a/test/perf.zig +++ b/test/perf.zig @@ -1956,6 +1956,30 @@ fn measureSearch(io: std.Io) !void { std.debug.print("prompt {s} \"{s}\": {d} instructions, {d} us (key and frame)\n", .{ opener, typed[0 .. n + 1], counter.read() -| was, (nowNs() -| t0) / 1000 }); } }; + + // `:` over the same file (core/Command.zig): each key typed into its + // field with its frame, its rows filtered; then Tab through `:theme + // `'s, the whole window wearing each. + const core = try boot(); + defer core.deinit(); + pardes.look.lookAt(core, 0, mb_path); + pump(core); + _ = try frame(core); + const line = ":theme "; + for (line, 0..) |c, n| { + const was = counter.read(); + const t0 = nowNs(); + core.update(.{ .key = .{ .cp = c, .text = &[_]u8{c} } }); + _ = try frame(core); + std.debug.print("colon \"{s}\": {d} instructions, {d} us (key and frame)\n", .{ line[0 .. n + 1], counter.read() -| was, (nowNs() -| t0) / 1000 }); + } + for (0..4) |n| { + const was = counter.read(); + const t0 = nowNs(); + core.update(.{ .key = .{ .cp = pardes.Key.tab } }); + _ = try frame(core); + std.debug.print("colon :theme Tab {d} ({s}): {d} instructions, {d} us (key and frame)\n", .{ n + 1, core.theme().name, counter.read() -| was, (nowNs() -| t0) / 1000 }); + } } /// `--pick`: a picker's hot paths (core/Pick.zig, walk UI line D), each |
