Update CSVParser to further increase csv ingest speed - #57
Merged
Conversation
Doubles.tryParse checks every candidate with a regex. Guard Double.parseDouble instead to avoid matcher allocations while preserving CSV value semantics.
Most ingested values are numeric. Parse them first so they do not require a lowercase copy only for boolean detection.
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.
Update CSV parser for more speed
This builds on the CSV ingestion optimizations from #54 with two additional parser improvements:
1ddfdaf— Replace regex-based CSV double parsing with a guardedDouble.parseDoublepath, reducing allocations.d853326— Parse numbers before booleans, avoiding unnecessary lowercase string creation on the common numeric path.Together with the two previous ingestion optimizations (
f3ce7ef,75c8ba4), this bringspostCsvthroughput to approximately 1.2M tuples/s.Benchmarks on my machine
Compared to main, we achieve an additional ~25% improvement with around 1.25M tuples/s.
Before (main on commit 4ce4460 with grouping and prefix reuse)
After (with additional csv parser update)