Enhance shared-string caching and buffer management in ExcelReader - #28
Merged
Conversation
added 3 commits
July 11, 2026 15:31
- Introduced a shared-string cache to optimize repeated string values in XLSX/XLSB formats. - Updated BufferedStreamCursor to allow dynamic initial buffer sizes based on entry length. - Improved row parsing efficiency by ensuring full row buffering before processing. - Refactored cell and row handling to accommodate shared-string caching, enhancing performance for large datasets.
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #28 +/- ##
==========================================
- Coverage 89.22% 89.12% -0.10%
==========================================
Files 77 77
Lines 5345 5363 +18
Branches 956 970 +14
==========================================
+ Hits 4769 4780 +11
- Misses 377 383 +6
- Partials 199 200 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Benchmark ResultsMeasured on ExcelReader.Benchmarks.CsvParseBenchmark
ExcelReader.Benchmarks.CsvReadBenchmark
ExcelReader.Benchmarks.CsvWriteBenchmark
ExcelReader.Benchmarks.ParseBenchmark
ExcelReader.Benchmarks.ReadBenchmark
ExcelReader.Benchmarks.WriteBenchmark
ExcelReader.Benchmarks.XlsReadBenchmark
ExcelReader.Benchmarks.XlsWriteBenchmark
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces several performance and memory optimizations for reading Excel files, particularly around buffer sizing, pooling, and string deduplication. The main themes are improved buffer management for large files, reduced allocations via pooling, and more efficient handling of shared strings in XLS and XLSB readers.
Buffer management and pooling improvements:
WorkbookLookups.InitialBufferCapacity,BufferedStreamCursor,XlsbReader.Enumerator). [1] [2] [3] [4] [5]XlsCompoundFile.cs,WorkbookStream.cs). [1] [2] [3] [4] [5] [6] [7]Shared string deduplication:
XlsReaderandXlsbReadernow lazily cache shared/categorical strings by their byte offset, ensuring repeated values are only decoded once per worksheet, which reduces memory and CPU usage for files with many repeated strings. [1] [2] [3] [4] [5] [6]CSV and parsing optimizations:
TypeMapper<T>). [1] [2]These changes collectively make reading large and/or repetitive Excel files faster and more memory-efficient, especially for workloads with many repeated strings or very large worksheets.