
The real smallest CSV parser in the world C#
I recently stumbled upon an interesting old project called “the world's smallest CSV parser,” and questions started swirling in my head Could I make it even smaller? Or implement it at an even lower level? And yes, I managed to keep it under 83 lines of code it's a NuGet package... It includes not only the parser itself but also a user API and its own method for writing to CSV. In my parser code, I opted out of using a garbage collector... I also use vector processor instructions there there’s no pointer handling, and no unnecessary branching either... The code is as low-level as C# allows and as fast as possible. It could be written even faster, but that would be extra code, and the goal itself is to have the smallest parser and break the record... Overall, there’s nothing more to say. If you have any comments or want to discuss this, I’m open to them.
project - https://github.com/pumpkin-bit/RawCSV