Skip to content

Conversation

@norberttech
Copy link
Member

@norberttech norberttech commented Jun 17, 2025

Resolves: #1718

Change Log


Added

  • `match_cases` and `match_condition` scalar functions

Fixed

Changed

Removed

Deprecated

Security

This is not yet fully decided, I'm opening this PR mostly to keep the logic in one place, but DSL function names are still something that can change.

@norberttech norberttech linked an issue Jun 17, 2025 that may be closed by this pull request
@github-actions
Copy link
Contributor

github-actions bot commented Jun 17, 2025

Flow PHP - Benchmarks

Results 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.795mb +0.08%  | 416.545ms -0.18% | ±0.35% -26.23%  |
| ExcelExtractorBench   | bench_extract_10k_ods  | 1    | 3   | 65.506mb +0.01% | 1.046s +0.72%    | ±1.05% +232.20% |
| ExcelExtractorBench   | bench_extract_10k_xlsx | 1    | 3   | 67.552mb +0.01% | 1.683s +0.63%    | ±0.96% -22.47%  |
| JsonExtractorBench    | bench_extract_10k      | 1    | 3   | 5.080mb +0.08%  | 1.160s -1.53%    | ±0.41% -23.23%  |
| ParquetExtractorBench | bench_extract_10k      | 1    | 3   | 86.350mb +0.00% | 915.559ms +0.07% | ±0.64% -2.77%   |
| TextExtractorBench    | bench_extract_10k      | 1    | 3   | 4.526mb +0.09%  | 38.914ms +0.91%  | ±0.49% -25.43%  |
| XmlExtractorBench     | bench_extract_10k      | 1    | 3   | 4.521mb +0.09%  | 597.169ms -0.78% | ±0.13% -79.88%  |
+-----------------------+------------------------+------+-----+-----------------+------------------+-----------------+
Transformers
+---------------------------------+--------------------------+------+-----+------------------+-----------------+----------------+
| benchmark                       | subject                  | revs | its | mem_peak         | mode            | rstdev         |
+---------------------------------+--------------------------+------+-----+------------------+-----------------+----------------+
| RenameEachEntryTransformerBench | bench_transform_10k_rows | 1    | 3   | 18.525mb +0.02%  | 73.449ms +0.79% | ±1.69% +46.83% |
| RenameEntryTransformerBench     | bench_transform_10k_rows | 1    | 3   | 123.263mb +0.00% | 65.361ms +0.72% | ±0.79% -31.89% |
+---------------------------------+--------------------------+------+-----+------------------+-----------------+----------------+
Loaders
+--------------------+----------------+------+-----+------------------+------------------+-----------------+
| benchmark          | subject        | revs | its | mem_peak         | mode             | rstdev          |
+--------------------+----------------+------+-----+------------------+------------------+-----------------+
| CSVLoaderBench     | bench_load_10k | 1    | 3   | 62.455mb +0.01%  | 86.470ms -0.63%  | ±1.61% -54.96%  |
| JsonLoaderBench    | bench_load_10k | 1    | 3   | 79.757mb +0.01%  | 102.165ms +2.10% | ±0.48% -70.57%  |
| ParquetLoaderBench | bench_load_10k | 1    | 3   | 166.232mb +0.00% | 20.904s +1.72%   | ±0.32% -7.64%   |
| TextLoaderBench    | bench_load_10k | 1    | 3   | 17.833mb +0.02%  | 30.209ms -0.99%  | ±1.23% +212.11% |
+--------------------+----------------+------+-----+------------------+------------------+-----------------+
Building Blocks
+-------------------+----------------------------+------+-----+------------------+------------------+------------------+
| benchmark         | subject                    | revs | its | mem_peak         | mode             | rstdev           |
+-------------------+----------------------------+------+-----+------------------+------------------+------------------+
| TypeDetectorBench | bench_type_detector        | 1    | 3   | 42.098mb +0.01%  | 425.027ms -0.48% | ±1.10% +1757.37% |
| TypeDetectorBench | bench_type_detector        | 1    | 3   | 11.476mb +0.03%  | 86.527ms +0.86%  | ±0.85% +44.72%   |
| EntryFactoryBench | bench_entry_factory        | 1    | 3   | 101.804mb +0.00% | 645.125ms -0.90% | ±0.99% +224.23%  |
| EntryFactoryBench | bench_entry_factory        | 1    | 3   | 53.155mb +0.01%  | 325.454ms +1.10% | ±0.34% -31.18%   |
| EntryFactoryBench | bench_entry_factory        | 1    | 3   | 14.405mb +0.03%  | 70.055ms +0.96%  | ±0.23% -14.46%   |
| RowsBench         | bench_chunk_10_on_10k      | 2    | 3   | 93.416mb +0.00%  | 3.769ms +9.26%   | ±3.04% -3.97%    |
| RowsBench         | bench_diff_left_1k_on_10k  | 2    | 3   | 110.787mb +0.00% | 240.958ms +2.74% | ±0.39% -6.26%    |
| RowsBench         | bench_diff_right_1k_on_10k | 2    | 3   | 93.507mb +0.00%  | 24.104ms +1.78%  | ±0.89% +137.88%  |
| RowsBench         | bench_drop_1k_on_10k       | 2    | 3   | 94.291mb +0.00%  | 1.676ms +4.48%   | ±2.89% +77.56%   |
| RowsBench         | bench_drop_right_1k_on_10k | 2    | 3   | 94.291mb +0.00%  | 1.739ms +29.72%  | ±1.97% -16.68%   |
| RowsBench         | bench_entries_on_10k       | 2    | 3   | 92.452mb +0.00%  | 3.505ms +2.89%   | ±0.83% -60.89%   |
| RowsBench         | bench_filter_on_10k        | 2    | 3   | 92.981mb +0.00%  | 16.078ms +2.84%  | ±0.62% -82.12%   |
| RowsBench         | bench_find_on_10k          | 2    | 3   | 92.981mb +0.00%  | 15.597ms +2.80%  | ±0.37% -71.36%   |
| RowsBench         | bench_find_one_on_10k      | 10   | 3   | 91.670mb +0.00%  | 1.994μs +10.77%  | ±2.40% +0.00%    |
| RowsBench         | bench_first_on_10k         | 10   | 3   | 91.670mb +0.00%  | 0.400μs +33.33%  | ±0.00% +0.00%    |
| RowsBench         | bench_flat_map_on_1k       | 2    | 3   | 100.730mb +0.00% | 15.226ms +7.85%  | ±3.22% +390.50%  |
| RowsBench         | bench_map_on_10k           | 2    | 3   | 130.157mb +0.00% | 67.452ms +2.37%  | ±0.75% +130.62%  |
| RowsBench         | bench_merge_1k_on_10k      | 2    | 3   | 93.501mb +0.00%  | 1.636ms +35.09%  | ±0.96% -72.87%   |
| RowsBench         | bench_partition_by_on_10k  | 2    | 3   | 96.870mb +0.00%  | 63.757ms +1.96%  | ±1.48% +143.89%  |
| RowsBench         | bench_remove_on_10k        | 2    | 3   | 94.553mb +0.00%  | 4.256ms +28.25%  | ±1.99% +123.44%  |
| RowsBench         | bench_sort_asc_on_1k       | 2    | 3   | 92.032mb +0.00%  | 41.354ms +5.35%  | ±0.60% -51.39%   |
| RowsBench         | bench_sort_by_on_1k        | 2    | 3   | 92.032mb +0.00%  | 41.028ms +2.73%  | ±1.02% +18.49%   |
| RowsBench         | bench_sort_desc_on_1k      | 2    | 3   | 92.032mb +0.00%  | 42.038ms +5.21%  | ±0.68% -52.47%   |
| RowsBench         | bench_sort_entries_on_1k   | 2    | 3   | 94.113mb +0.00%  | 8.841ms +7.64%   | ±2.87% +72.95%   |
| RowsBench         | bench_sort_on_1k           | 2    | 3   | 91.862mb +0.00%  | 30.890ms +4.85%  | ±0.25% -85.82%   |
| RowsBench         | bench_take_1k_on_10k       | 10   | 3   | 91.670mb +0.00%  | 14.894μs +8.24%  | ±0.32% -87.00%   |
| RowsBench         | bench_take_right_1k_on_10k | 10   | 3   | 91.670mb +0.00%  | 17.094μs +7.40%  | ±0.28% -90.99%   |
| RowsBench         | bench_unique_on_1k         | 2    | 3   | 110.788mb +0.00% | 241.890ms +1.46% | ±0.61% +710.92%  |
+-------------------+----------------------------+------+-----+------------------+------------------+------------------+

@codecov
Copy link

codecov bot commented Jun 17, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.93%. Comparing base (4bd62a7) to head (a8b4e22).
Report is 2 commits behind head on 1.x.

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##              1.x    #1720      +/-   ##
==========================================
+ Coverage   81.91%   81.93%   +0.02%     
==========================================
  Files         710      712       +2     
  Lines       19325    19343      +18     
==========================================
+ Hits        15830    15849      +19     
+ Misses       3495     3494       -1     
Components Coverage Δ
etl 88.39% <100.00%> (+0.03%) ⬆️
cli 84.42% <ø> (ø)
lib-array-dot 94.53% <ø> (ø)
lib-azure-sdk 62.56% <ø> (ø)
lib-doctrine-dbal-bulk 93.49% <ø> (ø)
lib-filesystem 78.02% <ø> (ø)
lib-types 54.82% <ø> (ø)
lib-parquet 84.37% <ø> (ø)
lib-parquet-viewer 82.02% <ø> (ø)
lib-snappy 91.16% <ø> (+0.46%) ⬆️
bridge-filesystem-async-aws 90.38% <ø> (ø)
bridge-filesystem-azure 89.92% <ø> (ø)
bridge-monolog-http 98.11% <ø> (ø)
symfony-http-foundation 74.41% <ø> (ø)
adapter-chartjs 86.45% <ø> (ø)
adapter-csv 90.37% <ø> (ø)
adapter-doctrine 89.95% <ø> (ø)
adapter-elasticsearch 97.19% <ø> (ø)
adapter-google-sheet 83.87% <ø> (ø)
adapter-http 59.15% <ø> (ø)
adapter-json 90.62% <ø> (ø)
adapter-logger 53.84% <ø> (ø)
adapter-meilisearch 97.75% <ø> (ø)
adapter-parquet 78.64% <ø> (ø)
adapter-text 84.44% <ø> (ø)
adapter-xml 83.15% <ø> (ø)
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@norberttech norberttech force-pushed the 1718-proposal-matchswitch branch from f244a4a to a8b4e22 Compare June 21, 2025 15:43
@norberttech norberttech merged commit 2335513 into 1.x Jun 21, 2025
24 checks passed
@norberttech norberttech deleted the 1718-proposal-matchswitch branch June 21, 2025 15:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Proposal]: Match/Switch

2 participants