EngineeringWednesday, December 10, 20258 min read

Handling 100K+ Row Imports Without Breaking a Sweat

Chunked parsing, web workers, and streaming — the techniques behind Xlork's large file support.

Christopher

Christopher

Author at Xlork

All posts
Handling 100K+ Row Imports Without Breaking a Sweat

Most data importers work fine with 100 rows. Maybe even 1,000. But what happens when a user drops a 250,000-row CSV into your import widget? If you're not prepared, the browser tab crashes, the UI freezes, and your user is gone. Handling large files isn't optional — it's what separates a toy import feature from a production-ready one.

At Xlork, we've spent significant engineering effort making large file imports smooth and reliable. In this post, we'll walk through the techniques we use — chunked parsing, Web Workers, streaming, virtual scrolling, and progressive validation — and how you can apply these principles in your own implementations.

11. The Browser Memory Problem

A 100K-row CSV with 20 columns is roughly 50-100MB of raw text. Parse that into JavaScript objects, and you're looking at 200-400MB of heap memory. Add a copy for the validated data, another for the display data, and the preview grid — and you've exceeded the typical browser tab's memory limit. The tab crashes or becomes unresponsive.

The solution isn't to load less data — your users genuinely need to import all 100K rows. The solution is to load data smarter: parse in chunks, process in background threads, and only render what's visible on screen.

22. Chunked Parsing with Streaming

Instead of parsing the entire file into memory at once, Xlork reads the file as a stream, processing it in chunks of 1,000-5,000 rows. Each chunk is parsed, validated, and stored independently. This keeps memory usage constant regardless of file size — you're only ever holding one chunk in active memory at a time.

💡 Pro tip

Streaming parsers read the file in fixed-size buffers (typically 64KB), emitting rows as they're parsed. This means a 500MB file doesn't consume 500MB of memory — it consumes roughly 64KB plus the size of the current chunk being processed.

33. Web Workers for Background Processing

JavaScript is single-threaded. If your parser runs on the main thread, the UI freezes while it processes the file — no scrolling, no clicking, no progress indicator. Xlork offloads all parsing and validation to a Web Worker, keeping the main thread free for UI interactions.

The Web Worker communicates progress back to the main thread via postMessage. Users see a real-time progress bar showing how many rows have been parsed, how many passed validation, and how many have errors. The UI remains fully responsive throughout the entire process.

44. Virtual Scrolling for Data Preview

Rendering 100,000 rows in the DOM is a non-starter. Even with lightweight table rows, that many DOM nodes will bring any browser to its knees. Xlork uses virtual scrolling — only the rows visible in the viewport (plus a small buffer) are actually rendered. As the user scrolls, old rows are removed and new ones are added.

This means the data preview is equally fast whether you have 100 rows or 100,000. The scrollbar accurately reflects the full dataset size, and jumping to any position is instantaneous.

55. Progressive Validation

Validating 100K rows with complex rules takes time. Instead of blocking the user until every row is validated, Xlork uses progressive validation: the first batch of rows is validated and displayed immediately, while remaining batches are validated in the background. Error counts update in real time as validation progresses.

  • First 1,000 rows validated and displayed in under 1 second
  • Full validation of 100K rows completes in 3-5 seconds via Web Workers
  • Error summary updates progressively — users can start reviewing errors immediately
  • Users can submit without waiting for full validation (configurable per deployment)

66. Practical Limits and Recommendations

Xlork's architecture handles files up to 500,000 rows in the browser. Beyond that, we recommend server-side processing with chunk-based upload. For most SaaS use cases, 500K rows is more than sufficient — the vast majority of user uploads are under 10,000 rows, with occasional outliers in the 50K-100K range.

7Conclusion

Large file handling isn't a feature — it's table stakes for a production data importer. Chunked parsing, Web Workers, virtual scrolling, and progressive validation are the techniques that make it work. Xlork implements all of these out of the box, so you don't have to build this infrastructure yourself.

#csv-import#data-engineering#best-practices#engineering

Ready to simplify data imports?

Drop a production-ready CSV importer into your app. Free tier included, no credit card required.

Keep reading

View all