In a customer project we generated Excel files on the server: reports that users downloaded straight from the web application. It worked, but it was slow, and every large export pushed the memory of the service up noticeably. With several users exporting at the same time, that became a real problem.
Where the memory went
The usual libraries build the whole workbook as an object model in memory first and only write it out at the end. Every cell becomes an object, every row a list. For a few hundred rows nobody notices. For a few hundred thousand, the export suddenly needs gigabytes, the garbage collector works overtime and the user waits for the first byte until the very last row is done.
I went through the problem together with AI: profiling, reading the XLSX format, sketching alternatives. What stood out was obvious in hindsight: an .xlsx file is a ZIP archive of XML files, and nothing forces you to hold it in memory. You can write each cell as UTF-8 XML the moment it arrives, compress it straight into a small buffer and pass that buffer on to the file or the HTTP response. That idea became Hypaxel.
What it looks like in C#
In ASP.NET Core, an export from Entity Framework is a single call. Rows stream from the database to the browser without ever being collected in a list:
using Hypaxel.AspNetCore;
app.MapGet("/orders.xlsx", (AppDb db) =>
Results.Extensions.Excel(db.Orders.AsNoTracking().AsAsyncEnumerable(), "orders"));
If you want to control styles and layout yourself, write cell by cell:
using Hypaxel;
using Hypaxel.Styling;
await using var writer = XlsxWriter.Create("orders.xlsx");
var money = writer.AddStyle(new CellStyle { NumberFormat = NumberFormats.Thousands2 });
var sheet = writer.AddWorksheet("Orders", new WorksheetOptions { FrozenRows = 1 });
await sheet.AddRowAsync("Id", "Customer", "Total", "Created");
foreach (var order in orders)
{
sheet.Write(order.Id);
sheet.Write(order.Customer);
sheet.Write(order.Total, money);
sheet.Write(order.CreatedAt);
await sheet.EndRowAsync();
}
await writer.CompleteAsync();
The numbers for .NET
Writing 100,000 rows with 10 columns on .NET 10 (Apple M1 Max, BenchmarkDotNet):
| Library | Time | Allocated |
|---|---|---|
Hypaxel, typed Write | 73 ms | 13 KB |
| Hypaxel, object mapping | 78 ms | 15 KB |
| SpreadCheetah | 74 ms | 16 KB |
| ClosedXML | 1,749 ms | 1,103 MB |
Depending on the .NET version, Hypaxel is roughly 19 to 24 times faster than ClosedXML's in-memory model at 100,000 rows and allocates kilobytes instead of gigabytes. At one million rows it needs about 0.7 seconds on .NET 10 and allocates less than 1 MB. SpreadCheetah, also a streaming writer, is on par with it; ClosedXML isn't measured at that size. Results for .NET 8 to .NET 11 and the methodology are on the benchmarks page.
Not just .NET
The same design exists for Rust, Python, Node.js, the browser (WebAssembly), Go, Java and PHP. .NET, Rust, Go, Java and PHP are independent native implementations; Python and Node.js build on the Rust core. Apart from PHP, every implementation can also read XLSX files as a stream.
Why open source
Slow Excel exports are not a problem only our customer had. Almost every business application has one somewhere, and more and more of that code is written by AI agents that reach for the familiar in-memory libraries. That's why Hypaxel is licensed under Apache 2.0. You can use it commercially, and an agent can pull it in like any other permissive library.
If you need more, there is a Pro license. It covers the whole legal entity, not each developer, agent or server. It includes the security and compliance modules we are building next, such as encrypted workbooks, sensitivity labels and digital signatures. Subscribers get them as they are released. The open-source core stays free.
Installation guide and API docs are on hypaxel.libs.vensas.de.
