Home / Companies / Tinybird / Blog / Post Details
Content Deep Dive

Splitting CSV files at 3GB/s

Blog post from Tinybird

Post Details
Company
Date Published
Author
Jose Munoz
Word Count
653
Company Posts That Month
2
Language
English
Hacker News Points
-
Post removed?
No
Summary

Dealing with large CSV files that cannot fit into RAM presents a challenge due to the presence of newline characters within quoted fields, which complicates the file-splitting process. The initial solution involved reading the entire file to accurately identify split points, prioritizing correctness over speed, but this approach proved to be inefficient with Python alone. The team then transitioned to a C implementation using CFFI, significantly boosting performance to 1GB/s. Further optimizations involved simplifying the algorithm and employing SIMD instructions, such as SSE and AVX, to process multiple bytes per iteration, ultimately achieving a processing speed of 3GB/s. Despite the complexity of the final version, these enhancements demonstrate significant improvements in throughput and efficiency when handling large CSV files.

Trends Found in this Post

No tracked trend matches for this post yet.

Use This Data

Use this post, company, and trend context to find content marketing opportunities, perform competitive analysis, or address product feature gaps via the Plushcap MCP server or the Plushcap API.