Performance of reading a file line by line in Zig

from blog openmymind.net, | ↗ original
Maybe I'm wrong, but I believe the canonical way to read a file, line by line, in Zig is: const std = @import("std"); pub fn main() !void { var gpa = std.heap.GeneralPurposeAllocator(.{}){}; const allocator = gpa.allocator(); var file = try std.fs.cwd().openFile("data.txt", .{}); defer file.close(); // Things are _a lot_ slower if we...