Adds a closure method to TransformerLoader#1495
Merged
norberttech merged 5 commits intoflow-php:1.xfrom Feb 23, 2025
Merged
Conversation
… signals to proxied loaders
Contributor
Flow PHP - BenchmarksResults of the benchmarks from this PR are compared with the results from 1.x branch. Extractors+-----------------------+-------------------+------+-----+-----------------+------------------+-----------------+
| benchmark | subject | revs | its | mem_peak | mode | rstdev |
+-----------------------+-------------------+------+-----+-----------------+------------------+-----------------+
| CSVExtractorBench | bench_extract_10k | 1 | 3 | 4.813mb +0.01% | 553.534ms -1.23% | ±0.70% -25.19% |
| JsonExtractorBench | bench_extract_10k | 1 | 3 | 4.886mb +0.01% | 1.065s +0.39% | ±0.24% -28.61% |
| ParquetExtractorBench | bench_extract_10k | 1 | 3 | 86.334mb +0.00% | 899.414ms +1.22% | ±0.64% +305.42% |
| TextExtractorBench | bench_extract_10k | 1 | 3 | 4.543mb +0.01% | 35.991ms +0.10% | ±0.17% -79.17% |
| XmlExtractorBench | bench_extract_10k | 1 | 3 | 4.518mb +0.01% | 605.098ms -0.79% | ±0.42% -46.10% |
+-----------------------+-------------------+------+-----+-----------------+------------------+-----------------+
Transformers+-----------------------------+--------------------------+------+-----+------------------+-----------------+----------------+
| benchmark | subject | revs | its | mem_peak | mode | rstdev |
+-----------------------------+--------------------------+------+-----+------------------+-----------------+----------------+
| RenameEntryTransformerBench | bench_transform_10k_rows | 1 | 3 | 127.340mb +0.00% | 71.017ms +3.00% | ±0.99% -23.93% |
+-----------------------------+--------------------------+------+-----+------------------+-----------------+----------------+
Loaders+--------------------+----------------+------+-----+------------------+------------------+-----------------+
| benchmark | subject | revs | its | mem_peak | mode | rstdev |
+--------------------+----------------+------+-----+------------------+------------------+-----------------+
| CSVLoaderBench | bench_load_10k | 1 | 3 | 64.013mb +0.00% | 105.188ms +2.23% | ±0.92% +60.61% |
| JsonLoaderBench | bench_load_10k | 1 | 3 | 84.360mb +0.00% | 96.199ms +2.85% | ±0.71% -32.23% |
| ParquetLoaderBench | bench_load_10k | 1 | 3 | 161.204mb +0.00% | 20.747s +0.87% | ±0.20% -42.08% |
| TextLoaderBench | bench_load_10k | 1 | 3 | 18.010mb +0.00% | 31.915ms +1.42% | ±2.79% +623.65% |
+--------------------+----------------+------+-----+------------------+------------------+-----------------+
Building Blocks+-------------------+----------------------------+------+-----+------------------+------------------+-----------------+
| benchmark | subject | revs | its | mem_peak | mode | rstdev |
+-------------------+----------------------------+------+-----+------------------+------------------+-----------------+
| EntryFactoryBench | bench_entry_factory | 1 | 3 | 105.983mb +0.00% | 455.515ms -0.93% | ±1.67% -0.09% |
| EntryFactoryBench | bench_entry_factory | 1 | 3 | 55.173mb +0.00% | 232.394ms -0.55% | ±1.90% +49.20% |
| EntryFactoryBench | bench_entry_factory | 1 | 3 | 14.695mb +0.00% | 50.052ms +0.17% | ±0.78% -33.80% |
| TypeDetectorBench | bench_type_detector | 1 | 3 | 43.883mb +0.00% | 361.354ms +0.12% | ±0.62% +130.23% |
| TypeDetectorBench | bench_type_detector | 1 | 3 | 11.693mb +0.00% | 73.330ms -0.08% | ±0.69% +29.25% |
| RowsBench | bench_chunk_10_on_10k | 2 | 3 | 97.026mb +0.00% | 3.458ms +7.42% | ±2.98% +25.39% |
| RowsBench | bench_diff_left_1k_on_10k | 2 | 3 | 114.313mb +0.00% | 185.084ms -0.89% | ±0.49% -69.12% |
| RowsBench | bench_diff_right_1k_on_10k | 2 | 3 | 97.033mb +0.00% | 18.664ms -1.64% | ±0.69% -46.12% |
| RowsBench | bench_drop_1k_on_10k | 2 | 3 | 97.901mb +0.00% | 1.564ms -5.14% | ±2.80% -26.68% |
| RowsBench | bench_drop_right_1k_on_10k | 2 | 3 | 97.901mb +0.00% | 1.588ms +10.31% | ±1.51% +403.06% |
| RowsBench | bench_entries_on_10k | 2 | 3 | 96.062mb +0.00% | 5.000ms +12.12% | ±3.32% +47.57% |
| RowsBench | bench_filter_on_10k | 2 | 3 | 96.591mb +0.00% | 16.686ms +0.70% | ±0.18% -85.19% |
| RowsBench | bench_find_on_10k | 2 | 3 | 96.591mb +0.00% | 16.833ms +2.93% | ±0.79% +1.43% |
| RowsBench | bench_find_one_on_10k | 10 | 3 | 95.282mb +0.00% | 1.994μs +10.77% | ±2.40% +0.00% |
| RowsBench | bench_first_on_10k | 10 | 3 | 95.282mb +0.00% | 0.400μs 0.00% | ±0.00% 0.00% |
| RowsBench | bench_flat_map_on_1k | 2 | 3 | 104.500mb +0.00% | 15.383ms +3.79% | ±2.66% +195.02% |
| RowsBench | bench_map_on_10k | 2 | 3 | 134.567mb +0.00% | 75.912ms +2.09% | ±1.38% +14.76% |
| RowsBench | bench_merge_1k_on_10k | 2 | 3 | 97.110mb +0.00% | 1.412ms +6.65% | ±1.35% -43.48% |
| RowsBench | bench_partition_by_on_10k | 2 | 3 | 100.413mb +0.00% | 65.864ms +2.77% | ±0.93% +25.25% |
| RowsBench | bench_remove_on_10k | 2 | 3 | 98.163mb +0.00% | 3.910ms +6.26% | ±0.86% -73.76% |
| RowsBench | bench_sort_asc_on_1k | 2 | 3 | 95.575mb +0.00% | 42.964ms +2.13% | ±1.11% +12.31% |
| RowsBench | bench_sort_by_on_1k | 2 | 3 | 95.576mb +0.00% | 44.232ms +4.79% | ±0.75% -35.61% |
| RowsBench | bench_sort_desc_on_1k | 2 | 3 | 95.575mb +0.00% | 44.261ms +4.44% | ±0.99% +17.65% |
| RowsBench | bench_sort_entries_on_1k | 2 | 3 | 97.722mb +0.00% | 8.210ms -0.43% | ±0.21% -65.56% |
| RowsBench | bench_sort_on_1k | 2 | 3 | 95.472mb +0.00% | 29.257ms -0.13% | ±1.31% +72.53% |
| RowsBench | bench_take_1k_on_10k | 10 | 3 | 95.282mb +0.00% | 13.537μs +4.64% | ±3.37% +56.20% |
| RowsBench | bench_take_right_1k_on_10k | 10 | 3 | 95.282mb +0.00% | 15.734μs +4.17% | ±1.31% -50.07% |
| RowsBench | bench_unique_on_1k | 2 | 3 | 114.314mb +0.00% | 189.198ms +0.40% | ±1.94% +11.51% |
+-------------------+----------------------------+------+-----+------------------+------------------+-----------------+
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## 1.x #1495 +/- ##
=======================================
Coverage 83.00% 83.00%
=======================================
Files 677 677
Lines 18076 18079 +3
=======================================
+ Hits 15004 15007 +3
Misses 3072 3072
|
Member
|
Good catch @christianc1! Could you please add a test that would cover this behavior? |
Member
|
Thank you @christianc1 🙏 |
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.
Adds a closure method to TransformerLoader to delegate generator stop signals to proxied loaders.
Change Log
Added
Fixed
Changed
Removed
Deprecated
Security
Description
This updates the
TransformerLoaderadding theTransformerLoader::closure()method. Many Loaders rely on being notified by the pipeline when the last set of Rows as been processed. For example, theJsonLoaderadapter uses this method to output the array closure after outputting the rows. Now,TransformerLoadersupportsLoaders implementing theClosureinterface.