Splitting CSV files at 3GB/s
Blog post from Tinybird
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.
No tracked trend matches for this post yet.
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.