feat(flow-php/etl): explicit sort algorithm selection and faster sorting - #2526
Merged
Conversation
- sort algorithm is user's choice via sort config, EXTERNAL_SORT is the default; memory fallback, sortMemoryLimit and OutOfMemoryException removed - ExternalSort spills buckets sized by new externalSortBucketSize config (default 10k rows) and streams the final merge instead of writing it back to cache - MemorySort buffers rows in a plain array instead of quadratic per-batch Rows::merge - Rows::sortAscending/sortDescending resolve sort values once per row instead of twice per comparison - RowsMinHeap compares sort values extracted at insert (ComparableBucketRow) - Floe SchemaTracker caches container-type fingerprints per Type instance
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## 1.x #2526 +/- ##
=========================================
Coverage 86.34% 86.34%
Complexity 22905 22905
=========================================
Files 1740 1740
Lines 70425 70417 -8
=========================================
- Hits 60806 60800 -6
+ Misses 9619 9617 -2 🚀 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.
Change Log
Added
flow-php/etl-externalSortBucketSizeconfig controlling rows per external sort bucket (default 10000)Fixed
Changed
flow-php/etl- sorting algorithm is an explicit choice via sort config,EXTERNAL_SORTis the defaultflow-php/etl- external sort spills fewer, larger buckets and streams the final merge instead of writing it back to cacheflow-php/etl-Rows::sortAscending/sortDescendingresolve sort values once per row instead of twice per comparisonflow-php/etl-RowsMinHeapcompares sort values extracted once at insertflow-php/etl-MemorySortbuffers rows in a plain array instead of per-batchRows::mergeflow-php/etl- FloeSchemaTrackercaches container type fingerprints perTypeinstanceRemoved
flow-php/etl-SortAlgorithms::MEMORY_FALLBACK_EXTERNAL_SORTandSortAlgorithms::SQLITE_SORTflow-php/etl-sortMemoryLimitconfig,FLOW_SORT_MAX_MEMORYenv var andOutOfMemoryExceptionDeprecated
Security
Sorting 100k rows in memory dropped from 80s to 6s (and it will drop even more once we resolve double validation issue of EntryFactory)