Repository navigation
Index into the record's values instead of enumerating them - #339
Merged
Merged
Conversation
DbfRecord.ParseValues enumerated Values, an IList<IDbfValue>, with foreach. Through the interface that allocates an enumerator for every row. Use an indexed loop instead. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
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.



DbfRecord.ParseValuesenumeratedValueswithforeach.Valuesis typedIList<IDbfValue>, so the enumerator is obtained through the interface and allocated on the heap for every row. This replaces it with an indexed loop: same values, same order, sameReadcalls.Measurements
Stopwatch harness, Release build, interleaved rounds,
tl_2019_01_place.dbf(587 rows × 16 columns), Apple M3 Max:Read()+GetValueon every fieldRead()onlyThe 23 KB is one 40-byte enumerator per row. For reference, the same harness gives Sylvan 257 µs and NDbf 381 µs.
These are harness numbers, not BenchmarkDotNet runs; the published benchmark measures the released package.
Testing
Full suite: 535 passed, 1 skipped (pre-existing).
🤖 Generated with Claude Code