How I accidently created the fastest CSV parser ever made

https://news.ycombinator.com/rss Hits: 2
Summary

home blogs about HOW I ACCIDENTALLY CREATED THE FASTEST CSV PARSER EVER MADE, cisv.2025-09-07 08:24 PM • 31 min read • #cpu #c #csv #perfsDISCLAIMERSThis project started as a fun experiment 2months ago and still evolving... therefore, i don't necessarily 100% recommend it as a must-use tool for now, as it may have its own flaws.The code has evolved over the course of this article, so some specific details and specifications may not be fully representative of the project currently live.I'm not an expert in CPU architectures, so I may be wrong on some points as am still learning. Feel free to point out any mistakes in the comments.HOW EVERYTHING STARTEDA while back, I wrote a piece on "the weird and wonderful concept of branchless programming". I explored the theory of how avoiding if statements and switch cases could, counter-intuitively, make code faster by eliminating CPU branch mispredictions. It was a fascinating dive into the mind of the processor, but theory is one thing. Practice is another beast entirely.After publishing that article, a thought started nagging at me: "It's all well and good to talk about this in the abstract, but what happens when you apply this philosophy to a real, notoriously branch-heavy problem?"And what problem is more plagued by unpredictable branches than parsing a CSV file? It's a chaotic mess of delimiters, quotes, and newlines. It was the perfect battlefield.This wasn't a task from a manager or a critique from a colleague. This was a self-inflicted challenge, i did to myself for 2months. A call to arms against my own conventional coding habits. I wanted to see if I could take the branchless principles, combine them with the raw power of modern CPU architecture, and build something not just fast, but absurdly fast. The goal: to create a CSV parser that treated the CPU not like a simple calculator, but like the parallel-processing monster it truly is... and then wrap that power in a Node.js library to see if native speed could oblite...

First seen: 2025-09-28 00:24

Last seen: 2025-09-28 02:25