Skip to content

Conversation

@christianc1
Copy link
Contributor

Change Log

Fixed

  • Removed redundant evaluation of transformer function.

Description

Fixed an issue where ScalarFunctionTransformers were evaluating their underlying transformer functions twice unnecessarily.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 29, 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.783mb +0.01%  | 559.630ms -3.80% | ±0.45% -83.47%  |
| JsonExtractorBench    | bench_extract_10k | 1    | 3   | 4.857mb +0.01%  | 1.072s +1.61%    | ±0.30% -79.24%  |
| ParquetExtractorBench | bench_extract_10k | 1    | 3   | 86.297mb +0.00% | 920.000ms +1.90% | ±0.57% +58.01%  |
| TextExtractorBench    | bench_extract_10k | 1    | 3   | 4.514mb +0.01%  | 35.306ms +0.41%  | ±0.81% +121.01% |
| XmlExtractorBench     | bench_extract_10k | 1    | 3   | 4.488mb +0.01%  | 606.605ms +0.86% | ±0.86% -69.76%  |
+-----------------------+-------------------+------+-----+-----------------+------------------+-----------------+
Transformers
+-----------------------------+--------------------------+------+-----+------------------+-----------------+----------------+
| benchmark                   | subject                  | revs | its | mem_peak         | mode            | rstdev         |
+-----------------------------+--------------------------+------+-----+------------------+-----------------+----------------+
| RenameEntryTransformerBench | bench_transform_10k_rows | 1    | 3   | 127.310mb +0.00% | 71.412ms -0.33% | ±0.93% +10.47% |
+-----------------------------+--------------------------+------+-----+------------------+-----------------+----------------+
Loaders
+--------------------+----------------+------+-----+------------------+------------------+-----------------+
| benchmark          | subject        | revs | its | mem_peak         | mode             | rstdev          |
+--------------------+----------------+------+-----+------------------+------------------+-----------------+
| CSVLoaderBench     | bench_load_10k | 1    | 3   | 63.981mb +0.00%  | 103.227ms -2.55% | ±0.21% -62.45%  |
| JsonLoaderBench    | bench_load_10k | 1    | 3   | 84.328mb +0.00%  | 97.862ms -0.75%  | ±0.23% -78.19%  |
| ParquetLoaderBench | bench_load_10k | 1    | 3   | 161.169mb +0.00% | 20.564s -0.50%   | ±0.37% +159.10% |
| TextLoaderBench    | bench_load_10k | 1    | 3   | 17.980mb +0.00%  | 31.157ms -1.14%  | ±0.94% +13.70%  |
+--------------------+----------------+------+-----+------------------+------------------+-----------------+
Building Blocks
+-------------------+----------------------------+------+-----+------------------+------------------+-----------------+
| benchmark         | subject                    | revs | its | mem_peak         | mode             | rstdev          |
+-------------------+----------------------------+------+-----+------------------+------------------+-----------------+
| EntryFactoryBench | bench_entry_factory        | 1    | 3   | 105.953mb +0.00% | 445.835ms -1.93% | ±1.69% +151.18% |
| EntryFactoryBench | bench_entry_factory        | 1    | 3   | 55.143mb +0.00%  | 229.052ms -2.05% | ±1.09% +50.86%  |
| EntryFactoryBench | bench_entry_factory        | 1    | 3   | 14.665mb +0.00%  | 50.043ms -1.82%  | ±1.24% +44.11%  |
| RowsBench         | bench_chunk_10_on_10k      | 2    | 3   | 96.996mb +0.00%  | 3.225ms -8.79%   | ±0.24% -90.83%  |
| RowsBench         | bench_diff_left_1k_on_10k  | 2    | 3   | 114.278mb +0.00% | 188.458ms +0.53% | ±0.64% -29.74%  |
| RowsBench         | bench_diff_right_1k_on_10k | 2    | 3   | 96.998mb +0.00%  | 19.062ms -0.39%  | ±2.40% +114.89% |
| RowsBench         | bench_drop_1k_on_10k       | 2    | 3   | 97.871mb +0.00%  | 1.687ms -6.92%   | ±1.03% -65.64%  |
| RowsBench         | bench_drop_right_1k_on_10k | 2    | 3   | 97.871mb +0.00%  | 1.476ms -29.13%  | ±2.76% +110.26% |
| RowsBench         | bench_entries_on_10k       | 2    | 3   | 96.032mb +0.00%  | 4.541ms -11.78%  | ±2.23% +25.74%  |
| RowsBench         | bench_filter_on_10k        | 2    | 3   | 96.561mb +0.00%  | 16.409ms -3.13%  | ±0.51% -25.20%  |
| RowsBench         | bench_find_on_10k          | 2    | 3   | 96.561mb +0.00%  | 16.481ms -2.45%  | ±1.44% +145.44% |
| RowsBench         | bench_find_one_on_10k      | 10   | 3   | 95.252mb +0.00%  | 1.706μs -14.95%  | ±2.72% +17.31%  |
| RowsBench         | bench_first_on_10k         | 10   | 3   | 95.252mb +0.00%  | 0.300μs -25.00%  | ±0.00% -100.00% |
| RowsBench         | bench_flat_map_on_1k       | 2    | 3   | 104.470mb +0.00% | 14.549ms -2.68%  | ±0.52% -74.22%  |
| RowsBench         | bench_map_on_10k           | 2    | 3   | 134.537mb +0.00% | 71.609ms -1.56%  | ±0.90% -31.74%  |
| RowsBench         | bench_merge_1k_on_10k      | 2    | 3   | 97.080mb +0.00%  | 1.374ms -15.08%  | ±3.59% +34.56%  |
| RowsBench         | bench_partition_by_on_10k  | 2    | 3   | 100.378mb +0.00% | 64.212ms -1.94%  | ±0.44% -87.77%  |
| RowsBench         | bench_remove_on_10k        | 2    | 3   | 98.133mb +0.00%  | 3.752ms -2.67%   | ±1.02% -21.33%  |
| RowsBench         | bench_sort_asc_on_1k       | 2    | 3   | 95.540mb +0.00%  | 41.433ms -3.94%  | ±0.70% +91.73%  |
| RowsBench         | bench_sort_by_on_1k        | 2    | 3   | 95.540mb +0.00%  | 41.903ms -4.83%  | ±1.32% +43.82%  |
| RowsBench         | bench_sort_desc_on_1k      | 2    | 3   | 95.540mb +0.00%  | 42.378ms -5.26%  | ±1.12% -26.23%  |
| RowsBench         | bench_sort_entries_on_1k   | 2    | 3   | 97.692mb +0.00%  | 8.289ms +0.40%   | ±0.38% -66.37%  |
| RowsBench         | bench_sort_on_1k           | 2    | 3   | 95.442mb +0.00%  | 29.552ms -0.03%  | ±1.03% +291.33% |
| RowsBench         | bench_take_1k_on_10k       | 10   | 3   | 95.252mb +0.00%  | 14.345μs +6.79%  | ±3.01% -0.67%   |
| RowsBench         | bench_take_right_1k_on_10k | 10   | 3   | 95.252mb +0.00%  | 15.694μs +3.33%  | ±0.30% -51.70%  |
| RowsBench         | bench_unique_on_1k         | 2    | 3   | 114.279mb +0.00% | 192.957ms +1.21% | ±0.69% -4.43%   |
| TypeDetectorBench | bench_type_detector        | 1    | 3   | 43.788mb +0.00%  | 360.317ms -0.30% | ±0.43% -43.68%  |
| TypeDetectorBench | bench_type_detector        | 1    | 3   | 11.598mb +0.00%  | 73.698ms +1.69%  | ±0.26% -50.81%  |
+-------------------+----------------------------+------+-----+------------------+------------------+-----------------+

@codecov
Copy link

codecov bot commented Jan 29, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.89%. Comparing base (9f6ed86) to head (0daafb6).
Report is 4 commits behind head on 1.x.

Additional details and impacted files
@@           Coverage Diff           @@
##              1.x    #1417   +/-   ##
=======================================
  Coverage   82.89%   82.89%           
=======================================
  Files         655      655           
  Lines       17522    17521    -1     
=======================================
  Hits        14524    14524           
+ Misses       2998     2997    -1     
Components Coverage Δ
etl 85.73% <100.00%> (-0.01%) ⬇️
cli 85.17% <ø> (ø)
lib-array-dot 94.53% <ø> (ø)
lib-azure-sdk 62.56% <ø> (ø)
lib-doctrine-dbal-bulk 97.36% <ø> (ø)
lib-filesystem 76.23% <ø> (ø)
lib-parquet 84.33% <ø> (ø)
lib-parquet-viewer 82.02% <ø> (ø)
lib-rdsl 87.09% <ø> (ø)
lib-snappy 91.16% <ø> (+0.46%) ⬆️
bridge-filesystem-async-aws 90.38% <ø> (ø)
bridge-filesystem-azure 89.92% <ø> (ø)
bridge-monolog-http 96.38% <ø> (ø)
symfony-http-foundation 77.10% <ø> (ø)
adapter-chartjs 86.45% <ø> (ø)
adapter-csv 89.49% <ø> (ø)
adapter-doctrine 90.14% <ø> (ø)
adapter-elasticsearch 97.19% <ø> (ø)
adapter-google-sheet 78.04% <ø> (ø)
adapter-http 59.15% <ø> (ø)
adapter-json 92.85% <ø> (ø)
adapter-logger 53.84% <ø> (ø)
adapter-meilisearch 97.75% <ø> (ø)
adapter-parquet 80.85% <ø> (ø)
adapter-text 84.44% <ø> (ø)
adapter-xml 83.15% <ø> (ø)

@norberttech norberttech merged commit d1ba94d into flow-php:1.x Jan 29, 2025
21 of 22 checks passed
@norberttech
Copy link
Member

thank you @christianc1!

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.

2 participants