Introduction
In modern web applications, generating large Excel files on the client side has become a common requirement. Whether you're building a data export tool, a reporting dashboard, or a financial analytics platform, the ability to create .xlsx files with a precise number of rows—ranging from a few hundred to hundreds of thousands—without freezing the UI is a technical challenge that demands careful architecture. As of 2026, the combination of WebAssembly (WASM) and Web Workers represents the gold standard for this task, offering near-native performance and true parallelism. In this article, we'll explore why this approach works, how to implement it, and what benchmarks you can expect.
The Problem: Why Naive JavaScript Fails for Large Excel Generation
Generating Excel files in the browser typically involves constructing an Open XML Spreadsheet (the internal format of .xlsx files). This includes building XML strings for worksheets, styles, shared strings, and relationships, then compressing them into a ZIP archive. A naive implementation in plain JavaScript—even with libraries like SheetJS (xlsx) or ExcelJS—runs into two critical bottlenecks:
- Single-threaded blocking: JavaScript's main thread handles both UI rendering and computation. Generating a file with 100,000 rows and 20 columns can take several seconds to minutes, during which the browser becomes unresponsive. According to a 2025 benchmark by the Web Performance Working Group, operations exceeding 50 ms on the main thread cause perceptible jank, and anything over 1 second triggers browser
Comments