Skip to content

feat(flow-php/etl): explicit sort algorithm selection and faster sorting - #2526

Merged
norberttech merged 1 commit into
1.xfrom
sorting-optimizaiton
Jul 11, 2026
Merged

feat(flow-php/etl): explicit sort algorithm selection and faster sorting#2526
norberttech merged 1 commit into
1.xfrom
sorting-optimizaiton

Conversation

@norberttech

Copy link
Copy Markdown
Member

Change Log


Added

  • flow-php/etl - externalSortBucketSize config controlling rows per external sort bucket (default 10000)

Fixed

Changed

  • flow-php/etl - sorting algorithm is an explicit choice via sort config, EXTERNAL_SORT is the default
  • flow-php/etl - external sort spills fewer, larger buckets and streams the final merge instead of writing it back to cache
  • flow-php/etl - Rows::sortAscending/sortDescending resolve sort values once per row instead of twice per comparison
  • flow-php/etl - RowsMinHeap compares sort values extracted once at insert
  • flow-php/etl - MemorySort buffers rows in a plain array instead of per-batch Rows::merge
  • flow-php/etl - Floe SchemaTracker caches container type fingerprints per Type instance

Removed

  • flow-php/etl - SortAlgorithms::MEMORY_FALLBACK_EXTERNAL_SORT and SortAlgorithms::SQLITE_SORT
  • flow-php/etl - sortMemoryLimit config, FLOW_SORT_MAX_MEMORY env var and OutOfMemoryException

Deprecated

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)

- 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
@norberttech norberttech added this to the 0.42.0 milestone Jul 11, 2026
@norberttech norberttech added the hackaton-07-2026 A first Flow Hackaton with Stloyd and MrHDOLEK 🎉 label Jul 11, 2026
@codecov

codecov Bot commented Jul 11, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.33962% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.34%. Comparing base (5807825) to head (b1bacfc).
⚠️ Report is 1 commits behind head on 1.x.
✅ All tests successful. No failed tests found.

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     
Components Coverage Δ
etl 89.88% <94.33%> (+0.01%) ⬆️
cli 89.40% <ø> (ø)
lib-array-dot 81.44% <ø> (ø)
lib-azure-sdk 64.44% <ø> (ø)
lib-doctrine-dbal-bulk 93.61% <ø> (ø)
lib-filesystem 86.04% <ø> (ø)
lib-types 90.18% <ø> (ø)
lib-parquet 70.23% <ø> (ø)
lib-parquet-viewer 82.26% <ø> (ø)
lib-snappy 88.93% <ø> (-0.45%) ⬇️
lib-dremel 0.00% <ø> (ø)
lib-postgresql 88.62% <ø> (ø)
lib-telemetry 86.58% <ø> (ø)
bridge-filesystem-async-aws 92.74% <ø> (ø)
bridge-filesystem-azure 90.45% <ø> (ø)
bridge-monolog-http 96.82% <ø> (ø)
bridge-monolog-telemetry 94.79% <ø> (ø)
bridge-openapi-specification 92.07% <ø> (ø)
symfony-http-foundation 78.57% <ø> (ø)
bridge-psr18-telemetry 100.00% <ø> (ø)
bridge-psr3-telemetry 98.95% <ø> (ø)
bridge-psr7-telemetry 100.00% <ø> (ø)
bridge-telemetry-otlp 90.41% <ø> (ø)
bridge-symfony-http-foundation-telemetry 92.85% <ø> (ø)
bridge-symfony-filesystem-bundle 90.66% <ø> (ø)
bridge-symfony-filesystem-cache 98.18% <ø> (ø)
bridge-symfony-postgresql-bundle 93.39% <ø> (ø)
bridge-symfony-postgresql-cache 94.41% <ø> (ø)
bridge-symfony-postgresql-messenger 98.80% <ø> (ø)
bridge-symfony-postgresql-session 93.65% <ø> (ø)
bridge-symfony-telemetry-bundle 90.10% <ø> (ø)
adapter-chartjs 84.05% <ø> (ø)
adapter-csv 91.66% <ø> (ø)
adapter-doctrine 90.79% <ø> (ø)
adapter-google-sheet 99.18% <ø> (ø)
adapter-http 73.23% <ø> (ø)
adapter-json 88.71% <ø> (ø)
adapter-logger 50.00% <ø> (ø)
adapter-parquet 83.16% <ø> (ø)
adapter-text 74.13% <ø> (ø)
adapter-xml 83.40% <ø> (ø)
adapter-avro 0.00% <ø> (ø)
adapter-excel 94.21% <ø> (ø)
adapter-postgresql 91.06% <ø> (ø)
adapter-seal 93.87% <ø> (ø)
bridge-phpunit-postgresql 75.30% <ø> (ø)
bridge-phpunit-telemetry 87.32% <ø> (ø)
bridge-phpstan-types 0.00% <ø> (ø)
bridge-postgresql-valinor 100.00% <ø> (ø)
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@norberttech
norberttech merged commit 8f73712 into 1.x Jul 11, 2026
46 checks passed
@norberttech
norberttech deleted the sorting-optimizaiton branch July 11, 2026 19:58
@github-project-automation github-project-automation Bot moved this from Todo to Done in Roadmap Jul 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hackaton-07-2026 A first Flow Hackaton with Stloyd and MrHDOLEK 🎉 size: L

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant