Repository navigation
perf(parser): reuse DAT line buffers and avoid duplicate prefix allocations - #72
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #72 +/- ##
==========================================
+ Coverage 97.35% 97.43% +0.08%
==========================================
Files 58 58
Lines 13403 13406 +3
==========================================
+ Hits 13048 13062 +14
+ Misses 355 344 -11 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
DAT parsing currently allocates every field just to recognize a record prefix and copies every raw line before parsing it. Inspect the borrowed prefix and reuse the line buffer, preserving the public parsed-line API, continuation handling, raw records and error behavior.
Three full-size comparisons reduced median fresh-import time from 279.90 to 256.28 seconds (8.4%). Including the previously merged removal of the counting pass, the controlled reduction is 14.5%. The production importer remains serial: both threaded prototypes regressed repeated fresh imports and spent more CPU. A single existing-database refresh pair favored threading, so that workload remains a candidate for repeated qualification. The receipts preserve both outcomes and reconstruct the prototypes without shipping their API.
The independent verifier accepted all 21 isolated fresh comparisons and five seeded refreshes, checking every stored field, primary key, sequence and schema object, with generated import timestamps validated separately. The exact final binary also matches both isolated references in full-sized fresh and seeded checks. The combined-index experiment saved another 61 seconds against its matching control; production index ownership remains separate work.
Validation: 697 workspace tests and three doctests on Rust 1.88, current-stable workspace Clippy, formatting, three comparison-oracle tests, and all code-checkpoint hosted checks pass. Regressions cover Unicode/CRLF/continuations, duplicate-record ordering, late malformed input, and callback-panic rollback/restoration. The existing transitive unty-next benchmark dependency moves to compatible 0.1.2 so the locked all-feature build works on Rust 1.88.
Full methodology, per-run measurements, source/binary hashes and limits are in docs/import-performance.md. This PR does not release a CLI version or deploy the service.