summaryrefslogtreecommitdiff
path: root/test/fs_bench.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-10-22 09:50:43 -0300
committerGabriel Schneider <[email protected]>2026-10-22 10:03:24 -0300
commita8b457a306a4442975210bcac3f04b56513c61c3 (patch)
tree6e2026ecb15da2fb919a0202f5d8b38e3b36a595 /test/fs_bench.zig
parenta8a1499bdffffc5b6919e24ec957e92fabaf003b (diff)
parent7e9d2c4169245072265b483ffaa6aa05f23f08d3 (diff)
downloadpardes-a8b457a306a4442975210bcac3f04b56513c61c3.tar.gz
pardes-a8b457a306a4442975210bcac3f04b56513c61c3.zip
Merge: Def/Refs, the diff viewer, Helix n/N, Callstack, Zig 0.17, Window mode and the terminal cwd fix onto 0.24
The docs keep both sides: 0.24's Ctrl-i fallbacks and typed ls with this line's Window mode, raw Esc and Helix n/N wording. The CHANGELOG's unreleased entries go above 0.24, Def/Refs and the context rows among them. cheatsheet-a4.pdf rendered again; .scratch/ ignored. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'test/fs_bench.zig')
-rw-r--r--test/fs_bench.zig10
1 files changed, 5 insertions, 5 deletions
diff --git a/test/fs_bench.zig b/test/fs_bench.zig
index 746fe737..a8a8fd8c 100644
--- a/test/fs_bench.zig
+++ b/test/fs_bench.zig
@@ -113,7 +113,7 @@ fn checkReply(s: *Session, req: ctlfs.Req, reply: ctlfs.Reply) !void {
if (reply.payload != .staged or reply.payload.staged != bytes.len or bytes.len > req.size)
return error.IncorrectReply;
const pane = s.core.panes[s.file_id].?;
- if (req.node == @intFromEnum(ctlfs.TopFile.index)) {
+ if (req.node == @backingInt(ctlfs.TopFile.index)) {
var expected_buf: [4200]u8 = undefined;
const expected = try std.fmt.bufPrint(&expected_buf, "{d} text {d} {s}\n", .{ s.file_serial, @intFromBool(pane.file.?.revision != pane.file.?.saved_revision), pane.file.?.path });
if (!std.mem.eql(u8, expected, bytes)) return error.IncorrectReply;
@@ -134,7 +134,7 @@ fn checkReply(s: *Session, req: ctlfs.Req, reply: ctlfs.Reply) !void {
if (reply.payload != .staged or reply.payload.staged != bytes.len or bytes.len > req.size)
return error.IncorrectReply;
const names = [_][]const u8{ "README", "index", "status", "focus", "ctl", "commands", "look", "exec", "log", "screen", "listeners", "pane", "os" };
- const nodes = [_]u64{ @intFromEnum(ctlfs.TopFile.README), @intFromEnum(ctlfs.TopFile.index), @intFromEnum(ctlfs.TopFile.status), @intFromEnum(ctlfs.TopFile.focus), @intFromEnum(ctlfs.TopFile.ctl), @intFromEnum(ctlfs.TopFile.commands), @intFromEnum(ctlfs.TopFile.look), @intFromEnum(ctlfs.TopFile.exec), @intFromEnum(ctlfs.TopFile.log), @intFromEnum(ctlfs.TopFile.screen), @intFromEnum(ctlfs.TopFile.listeners), @intFromEnum(ctlfs.TopFile.pane), filesystem.os_root };
+ const nodes = [_]u64{ @backingInt(ctlfs.TopFile.README), @backingInt(ctlfs.TopFile.index), @backingInt(ctlfs.TopFile.status), @backingInt(ctlfs.TopFile.focus), @backingInt(ctlfs.TopFile.ctl), @backingInt(ctlfs.TopFile.commands), @backingInt(ctlfs.TopFile.look), @backingInt(ctlfs.TopFile.exec), @backingInt(ctlfs.TopFile.log), @backingInt(ctlfs.TopFile.screen), @backingInt(ctlfs.TopFile.listeners), @backingInt(ctlfs.TopFile.pane), filesystem.os_root };
var off: usize = 0;
var entry: usize = 0;
while (off < bytes.len) : (entry += 1) {
@@ -253,7 +253,7 @@ pub fn main(init: std.process.Init) !void {
try bench(&s, "read index", reps, .{
.tag = 6,
.op = .read,
- .node = @intFromEnum(ctlfs.TopFile.index),
+ .node = @backingInt(ctlfs.TopFile.index),
.size = 4096,
}, "one line per pane");
try bench(&s, "readdir root", reps, .{
@@ -272,7 +272,7 @@ pub fn main(init: std.process.Init) !void {
.tag = 9,
.op = .write,
.node = s.node(.body),
- .data = "x" ** 1024,
+ .data = &@as([1024]u8, @splat('x')),
.size = 1024,
}, "append: whole-body swap + undo snapshot");
@@ -327,7 +327,7 @@ pub fn main(init: std.process.Init) !void {
try w.writeAll("]}\n");
} else {
try w.print("{s:<26} {s:>9} {s:>8} {s}\n", .{ "request", "ns/op", "allocs", "note" });
- try w.print("{s:<26} {s:>9} {s:>8} {s}\n", .{ "-" ** 26, "-" ** 9, "-" ** 8, "-" ** 20 });
+ try w.print("{s:<26} {s:>9} {s:>8} {s}\n", .{ &@as([26]u8, @splat('-')), &@as([9]u8, @splat('-')), &@as([8]u8, @splat('-')), &@as([20]u8, @splat('-')) });
for (rows.items) |r|
try w.print("{s:<26} {d:>9} {d:>8} {s}\n", .{ r.name, r.ns, r.allocs, r.note });
}