csv-zero is a low-level, zero-allocation CSV parsing library designed for performance-sensitive applications. By focusing on field-based iteration and SIMD acceleration, it provides precise control over CSV data processing without unnecessary abstractions or memory allocation. Ideal for systems engineers who prioritize efficiency.
csv-zero is an efficient CSV parsing library written in Zig, designed for performance-sensitive applications. This library features a zero-allocation and SIMD-accelerated field iterator, intentionally omitting common abstractions for maximum control and transparency.
csv-zero is all about simplicity and high performance:
*std.Io.Reader.The design choice to use a field iterator means that csv-zero:
To illustrate how to use the library: Count the number of rows and fields:
while (true) {
const field = it.next() catch |err| switch (err) {
csvz.Iterator.Error.EOF => break,
else => return err,
};
fields += 1;
rows += @intFromBool(field.last_column);
}
Print every parsed field:
while (true) {
var field = it.next() catch |err| switch (err) {
error.EOF => break,
else => return err,
};
std.debug.print("field[{d}][{d}] = {s}\n", .{ row, col, field.unescaped() });
}
For performance context, csv-zero has been benchmarked against other high-quality CSV parsers in the complementary project csv-race, which evaluates numerous CSV libraries. Results consistently show csv-zero achieving top performance metrics, making it an ideal choice for anyone requiring speed and efficiency in CSV processing.
The library offers a C API, though it's recommended to use the Zig implementation for full performance benefits, minimizing cross-language overhead.
In conclusion, csv-zero is tailored for developers needing precise control over CSV parsing with minimal overhead, establishing an effective foundation for high-performance applications. For further details, refer to the associated documentation and examples.
No comments yet.
Sign in to be the first to comment.