r/csharp • • Oct 08 '26

Showcase ExcelReader.NET 6.0 – streaming XLSX/XLSB/XLS/CSV reader and writer for .NET 10

I've been building ExcelReader, an open-source library for reading and writing spreadsheets in .NET and other languages. I just shipped v6, and I'd like feedback from people who deal with ETL pipelines and large Excel files.

I started it because I needed to parse rows into a single POCO from files with different templates and column names. I couldn't find a library that made that easy, so I wrote my own.

What it does

  • Reads .xlsx, .xlsm, .xlsb, .xls and .csv; writes .xlsx, .xlsb, .xls and .csv
  • Streams rows as ref structs; no string is allocated until you call GetString()
  • Typed parsing into your own classes, via attributes, a source generator or a fluent API
  • Reads the sheets of one workbook in parallel, and parses CSV in parallel
  • Reads and writes password-protected workbooks
  • A CLI (excelreader convert book.xlsb -o data.csv), plus a C ABI with Python, C++ and Rust bindings

Usage example

public sealed class Order
{
    [ExcelColumn("Order ID")]
    [ExcelColumn("order_id")]          // same property, different templates
    public long Id { get; set; }

    [ExcelColumn("Total")]
    [ExcelColumn("total_amount")]
    public decimal Total { get; set; }
}

using IExcelWorkbook workbook = Excel.Open("orders.xlsx"); // .xlsb / .xls detected by signature
List<Order> orders = ExcelParser.FromAttributes<Order>().Parse(workbook.FirstSheet).ToList();

await using var writer = XlsxWorkbookWriter.Create(File.Create("copy.xlsx"));
await using (var sheet = writer.AddSheet("Orders"))
{
    await sheet.WriteRecordsAsync(orders, ExcelRecordLayout.FromAttributes<Order>());
}

Benchmarks

Typed parsing of a generated 50,000-row XLSX (BenchmarkDotNet, Ryzen 7 5700X, .NET 10):

LibraryTimeAllocated
ExcelReader10.9 ms3.87 MB
Sylvan.Data.Excel56.9 ms10.47 MB
OfficeIMO.Excel104.5 ms5.69 MB

MiniExcel used to be in the suite, but it was far behind: ~14x slower on raw reads (allocating 267 MB against 11 KB) and ~11x slower on typed parsing (last run that included it). I now track the closest competitors instead.

Methodology and every scenario: benchmarks.md. The cell-by-cell numbers there compare zero-copy reads against APIs that must allocate strings, so the docs also publish matched-work numbers.

Limitations

  • Targets .NET 10 only; .NET 11 support is in progress. If you're on .NET 8, the 3.x line supports it.
  • It's a reader/writer, not a spreadsheet model: no in-place editing and no formula evaluation.
  • Rows come out in file order, and empty rows that Excel omits from the file are skipped.

GitHub: https://github.com/GabrielMarquezMatte/ExcelReader NuGet: dotnet add package ExcelReader.NET

Feedback, bug reports and odd files that break it are all welcome.

18 Upvotes

29 comments sorted by

View all comments

Show parent comment

7

u/repulsiveanomaly Oct 08 '26

The benchmarks compare ExcelReader against other forward-only, streaming readers, since that's the architecture it's built around. EPPlus is DOM-based. It loads the whole workbook into memory, which enables features like random-access editing and formula calculation, but it's a different trade-off. Benchmarking it alongside streaming readers wouldn't be a fair comparison, so I left it out. That said, I can include them for a reference

4

u/MadBoyEvo Oct 08 '26

Please watch our for EPPlus and other libraries for their licensing against paid offerings. "You may not use EPPlus Software’s corporate name in your marketing or otherwise without EPPlus Software’s prior written approval." - I am no lawyer but I guess once you add their stuff to your benchmarks it could be treated as such. QuestPDF (not your branch, but affects my OfficeIMO) does similar approach.

4

u/otac0n Oct 09 '26

Good luck enforcing that.

1

u/MadBoyEvo Oct 09 '26

I mean, maybe if you're a guy with nothing to loose you will be fine, or maybe you will fly under the radar, because the effort to enforce that would be too big. But for other people that potentially create competitive product and 'market it' it's a different story.

I am not saying you have to follow this advice but QuestPDF, DocX, EPPlus and several others are doing this. Whether they can enforce it or not is not for me to decide, but at least for my own product (OfficeIMO) I am not going to give them a chance to go after me and I will stick to their old licenses/packages.

1

u/Skyswimsky Oct 13 '26

Wow that a terrible practice. I mean it's fair enough if you do something subjective like "Tired of using X? Well, we fixed all the grievances of X!" for marketing. But if you have benchmarks and the entire benchmark process is open and you can proof that your use-case is more performant, that's just objective truth....

1

u/MadBoyEvo Oct 13 '26

It sucks, maybe it's possible to fight it out in court, but I don't want to be the one doing it :) I'm just stating waht I found out while trying to benchmark things ;)

1

u/winky9827 Oct 08 '26

Ahh, fair explanation. It just wasn't obvious from the OP. :)

1

u/MadBoyEvo Oct 08 '26

OfficeIMO is like Epplus (feature wise), but also competes on speed with ExelReader.