summaryrefslogtreecommitdiff
path: root/bench/src/ziglyph_caseless.zig
diff options
context:
space:
mode:
Diffstat (limited to 'bench/src/ziglyph_caseless.zig')
-rw-r--r--bench/src/ziglyph_caseless.zig10
1 files changed, 5 insertions, 5 deletions
diff --git a/bench/src/ziglyph_caseless.zig b/bench/src/ziglyph_caseless.zig
index f80668e..842de44 100644
--- a/bench/src/ziglyph_caseless.zig
+++ b/bench/src/ziglyph_caseless.zig
@@ -3,14 +3,14 @@ const std = @import("std");
3const Normalizer = @import("ziglyph").Normalizer; 3const Normalizer = @import("ziglyph").Normalizer;
4 4
5pub fn main() !void { 5pub fn main() !void {
6 var args_iter = std.process.args();
7 _ = args_iter.skip();
8 const in_path = args_iter.next() orelse return error.MissingArg;
9
10 var arena = std.heap.ArenaAllocator.init(std.heap.page_allocator); 6 var arena = std.heap.ArenaAllocator.init(std.heap.page_allocator);
11 defer arena.deinit(); 7 defer arena.deinit();
12 const allocator = arena.allocator(); 8 const allocator = arena.allocator();
13 9
10 var args_iter = try std.process.argsWithAllocator(allocator);
11 _ = args_iter.skip();
12 const in_path = args_iter.next() orelse return error.MissingArg;
13
14 const input = try std.fs.cwd().readFileAlloc( 14 const input = try std.fs.cwd().readFileAlloc(
15 allocator, 15 allocator,
16 in_path, 16 in_path,
@@ -31,5 +31,5 @@ pub fn main() !void {
31 @memcpy(buf[0..line.len], line); 31 @memcpy(buf[0..line.len], line);
32 prev_line = buf[0..line.len]; 32 prev_line = buf[0..line.len];
33 } 33 }
34 std.debug.print("Ziglyph Normalizer.eqlCaseless: result: {}, took: {}\n", .{ result, timer.lap() / std.time.ns_per_ms }); 34 std.debug.print("Ziglyph Normalizer.eqlCaseless: result: {}, took: {}\n", .{ result, std.fmt.fmtDuration(timer.lap() / std.time.ns_per_ms) });
35} 35}