Repository navigation
perf: faster writer, XLSX canonical path and Python bindings; fix: verify sheet CRC-32, clear trim warnings - #160
Merged
Merged
Conversation
… of its rows The XLSX and XLSB enumerators and the SheetParallel chunk producer stopped at </sheetData> or BrtEndSheetData without reading the rest of the entry, so the checksum, compared only once the declared length had been produced, was never checked when anything followed the sheet data beyond the current buffer. A damaged package then read without error. Reaching the end of the rows now reads the remainder when checksums are verified.
StyleTable.DateVariant took a lock on every date cell written under a style, and parallel record writers share one table across workers. A styled date column made an 8-way parallel XLSX write 30% slower than the same write unstyled. Known variants are now read from a copy-on-write array; only the first resolution of a style takes the lock.
… to the inline emitter
SyncRowEnumerator boxed value-type models through RuntimeHelpers.GetUninitializedObject(typeof(T)), which needs constructor annotations on T; RuntimeHelpers.Box carries no trimming requirement and also boxes Nullable<T> correctly. SheetDataReader.TypeOf now carries the same DynamicallyAccessedMembers annotation as the GetFieldType it feeds. Both broke builds that enable the trim and AOT analyzers on Core, such as the NativeAOT publishes.
… no worker added one
…instead of decoding it to a string
…instead of copying it
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #160 +/- ##
==========================================
- Coverage 92.12% 92.10% -0.02%
==========================================
Files 285 285
Lines 23282 23406 +124
Branches 3771 3810 +39
==========================================
+ Hits 21448 21558 +110
- Misses 1245 1257 +12
- Partials 589 591 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
added 5 commits
October 28, 2026 10:29
…ve code readability
…, and Writing snippets
… across various formats
…e readability in Parsing, Reading, and Writing snippets
…tion and untrusted input documentation
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.
Summary
Two correctness fixes and a batch of performance work across the reader, writer, generator, native exports and Python binding. No public API or ABI changes.
Fixes
SheetParallelchunk producer stopped at</sheetData>/BrtEndSheetDatawithout reading the rest of the entry. The checksum was only compared once the declared length had been produced, so it was never checked, and a damaged package read without error.SyncRowEnumeratornow boxes value-type models throughRuntimeHelpers.Box, which has no trimming requirement and boxesNullable<T>correctly.SheetDataReader.TypeOfcarries the sameDynamicallyAccessedMembersannotation as theGetFieldTypeit feeds. Both warnings broke builds that enable the trim and AOT analyzers on Core, such as the NativeAOT publishes.Performance
Reader / parser
SheetDataReader.GetValuereuses boxed booleans.longlookup.Writer
StyleTable.DateVariantreads known variants from a copy-on-write array and takes the lock only on a style's first resolution. Before this, a styled date column made an 8-way parallel XLSX write about 30% slower than the same write unstyled.Generator
ReadOnlySpan<byte>member is written throughWriteUtf8instead of being decoded to a string.Native / Python
Tests
New or extended tests cover CRC verification (
ZipChecksumTests), the canonical cell path (XlsxCanonicalCellTests), enum parsing (EnumParsingTests) and the worker string cache (WorkerStringCacheTests).GeneratorTestsis updated for the new generator output.Test plan
dotnet testpasses on Core