Zero-allocation, simd-accelerated CSV iterator and emitter in Zig with an optional C ABI option

,

My first Zig project that I feel I can share with folks here!

I wanted to see if I could use SIMD for parsing CSV files quickly and went down a whole rabbit hole and learned a lot of different concepts in the way.

I made a benchmarking repository to compare it to some other libraries out there (using poop and now crap! for macOS). Then decided to make it a bit more polished and use it as a general CSV benchmarking tool so maybe other CSV library authors can use it to fine-tune their implementations.
But to my pleasant surprise, the code does really well actually on my CPU and on M3.

11 Likes

Dang!! Annihilation! I know it’s not all about the gold medals, but must feel great. :slight_smile:

1 Like

Does it support quoted fields, including quoted fields that contain line breaks? Excel CSV supports such things. CSV being a format without any formal specification or standard, just a whole bunch of data and varying implementations in the wild.

Why thanks!! Yes it does feel great haha.

CSV actually does allegedly have a standard but it gets ignored in a lot of place.

To answer your question, yes it does support quoted regions and quoted regions can have LF, CRLF or the delimiter. They get treated as part of the field’s content.

1 Like