Skip to content

Conversation

@stloyd
Copy link
Member

@stloyd stloyd commented May 10, 2025

Change Log

Added

  • Add a new `RenameEachEntryTransformerBench` benchmark

Fixed

Changed

Removed

Deprecated

Security


Description

To optimise this transformer, I would like to cover it with a benchmark, as we have for a single rename one.

@stloyd stloyd requested a review from norberttech as a code owner May 10, 2025 07:37
@github-actions
Copy link
Contributor

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.886mb +0.01%  | 615.837ms +0.72% | ±0.17% -11.71%  |
| JsonExtractorBench    | bench_extract_10k | 1    | 3   | 5.473mb +0.01%  | 1.345s -0.83%    | ±0.82% -57.69%  |
| ParquetExtractorBench | bench_extract_10k | 1    | 3   | 86.483mb +0.00% | 932.249ms -0.19% | ±0.11% -77.52%  |
| TextExtractorBench    | bench_extract_10k | 1    | 3   | 4.610mb +0.01%  | 38.856ms +0.04%  | ±0.18% +504.09% |
| XmlExtractorBench     | bench_extract_10k | 1    | 3   | 4.585mb +0.01%  | 609.746ms -0.33% | ±0.88% +110.48% |
+-----------------------+-------------------+------+-----+-----------------+------------------+-----------------+
Transformers
+---------------------------------+--------------------------+------+-----+------------------+-----------------+-----------------+
| benchmark                       | subject                  | revs | its | mem_peak         | mode            | rstdev          |
+---------------------------------+--------------------------+------+-----+------------------+-----------------+-----------------+
| RenameEntryTransformerBench     | bench_transform_10k_rows | 1    | 3   | 127.408mb +0.00% | 69.430ms +0.40% | ±1.32% +221.75% |
| RenameEachEntryTransformerBench | bench_transform_10k_rows | 1    | 3   | ERR              | 72.276ms +0.00% | ±0.23% +0.00%   |
+---------------------------------+--------------------------+------+-----+------------------+-----------------+-----------------+
Loaders
+--------------------+----------------+------+-----+------------------+------------------+----------------+
| benchmark          | subject        | revs | its | mem_peak         | mode             | rstdev         |
+--------------------+----------------+------+-----+------------------+------------------+----------------+
| CSVLoaderBench     | bench_load_10k | 1    | 3   | 64.053mb +0.00%  | 104.471ms +1.59% | ±0.72% -19.74% |
| JsonLoaderBench    | bench_load_10k | 1    | 3   | 84.085mb +0.00%  | 95.326ms -1.04%  | ±0.78% +8.90%  |
| ParquetLoaderBench | bench_load_10k | 1    | 3   | 166.567mb +0.00% | 20.662s -0.88%   | ±0.12% -70.42% |
| TextLoaderBench    | bench_load_10k | 1    | 3   | 18.143mb +0.00%  | 29.354ms -5.72%  | ±0.38% +57.07% |
+--------------------+----------------+------+-----+------------------+------------------+----------------+
Building Blocks
+-------------------+----------------------------+------+-----+------------------+------------------+-----------------+
| benchmark         | subject                    | revs | its | mem_peak         | mode             | rstdev          |
+-------------------+----------------------------+------+-----+------------------+------------------+-----------------+
| TypeDetectorBench | bench_type_detector        | 1    | 3   | 44.054mb +0.00%  | 459.079ms -0.10% | ±1.02% +82.08%  |
| TypeDetectorBench | bench_type_detector        | 1    | 3   | 11.864mb +0.00%  | 93.198ms -0.48%  | ±0.09% -91.93%  |
| RowsBench         | bench_chunk_10_on_10k      | 2    | 3   | 97.073mb +0.00%  | 3.185ms -9.71%   | ±0.83% -46.73%  |
| RowsBench         | bench_diff_left_1k_on_10k  | 2    | 3   | 114.429mb +0.00% | 182.470ms +0.35% | ±1.24% +27.66%  |
| RowsBench         | bench_diff_right_1k_on_10k | 2    | 3   | 97.149mb +0.00%  | 18.344ms +1.48%  | ±0.91% -53.00%  |
| RowsBench         | bench_drop_1k_on_10k       | 2    | 3   | 97.948mb +0.00%  | 1.439ms -17.05%  | ±1.21% -30.62%  |
| RowsBench         | bench_drop_right_1k_on_10k | 2    | 3   | 97.948mb +0.00%  | 1.432ms -18.61%  | ±0.56% -82.15%  |
| RowsBench         | bench_entries_on_10k       | 2    | 3   | 96.108mb +0.00%  | 3.805ms -20.87%  | ±0.48% -66.45%  |
| RowsBench         | bench_filter_on_10k        | 2    | 3   | 96.637mb +0.00%  | 16.258ms -0.97%  | ±0.85% -43.35%  |
| RowsBench         | bench_find_on_10k          | 2    | 3   | 96.637mb +0.00%  | 15.853ms -5.30%  | ±1.76% +96.99%  |
| RowsBench         | bench_find_one_on_10k      | 10   | 3   | 95.329mb +0.00%  | 1.994μs 0.00%    | ±2.40% 0.00%    |
| RowsBench         | bench_first_on_10k         | 10   | 3   | 95.329mb +0.00%  | 0.400μs 0.00%    | ±0.00% 0.00%    |
| RowsBench         | bench_flat_map_on_1k       | 2    | 3   | 104.547mb +0.00% | 15.336ms -1.25%  | ±2.17% +106.23% |
| RowsBench         | bench_map_on_10k           | 2    | 3   | 134.614mb +0.00% | 71.006ms -2.41%  | ±1.01% -5.15%   |
| RowsBench         | bench_merge_1k_on_10k      | 2    | 3   | 97.157mb +0.00%  | 1.297ms -15.21%  | ±2.46% +116.68% |
| RowsBench         | bench_partition_by_on_10k  | 2    | 3   | 100.529mb +0.00% | 62.917ms -0.73%  | ±1.73% +112.52% |
| RowsBench         | bench_remove_on_10k        | 2    | 3   | 98.210mb +0.00%  | 3.734ms -15.29%  | ±0.75% -54.99%  |
| RowsBench         | bench_sort_asc_on_1k       | 2    | 3   | 95.691mb +0.00%  | 40.884ms -1.09%  | ±1.06% -34.64%  |
| RowsBench         | bench_sort_by_on_1k        | 2    | 3   | 95.692mb +0.00%  | 40.807ms -2.08%  | ±1.02% -64.39%  |
| RowsBench         | bench_sort_desc_on_1k      | 2    | 3   | 95.691mb +0.00%  | 40.543ms +0.13%  | ±1.29% -46.77%  |
| RowsBench         | bench_sort_entries_on_1k   | 2    | 3   | 97.769mb +0.00%  | 8.168ms -2.03%   | ±0.88% -15.62%  |
| RowsBench         | bench_sort_on_1k           | 2    | 3   | 95.519mb +0.00%  | 30.223ms +0.30%  | ±0.98% +126.50% |
| RowsBench         | bench_take_1k_on_10k       | 10   | 3   | 95.329mb +0.00%  | 13.180μs -11.36% | ±1.28% -19.92%  |
| RowsBench         | bench_take_right_1k_on_10k | 10   | 3   | 95.329mb +0.00%  | 15.340μs -5.99%  | ±3.27% +145.12% |
| RowsBench         | bench_unique_on_1k         | 2    | 3   | 114.430mb +0.00% | 186.624ms +1.13% | ±1.22% +143.28% |
| EntryFactoryBench | bench_entry_factory        | 1    | 3   | 105.519mb +0.00% | 716.173ms -1.54% | ±1.22% +23.52%  |
| EntryFactoryBench | bench_entry_factory        | 1    | 3   | 55.029mb +0.00%  | 364.952ms +0.90% | ±0.62% +36.14%  |
| EntryFactoryBench | bench_entry_factory        | 1    | 3   | 14.807mb +0.00%  | 78.274ms +0.77%  | ±1.34% +194.64% |
+-------------------+----------------------------+------+-----+------------------+------------------+-----------------+

@codecov
Copy link

codecov bot commented May 10, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.26%. Comparing base (46beb43) to head (5a9aa63).
Report is 2 commits behind head on 1.x.

Additional details and impacted files
@@           Coverage Diff           @@
##              1.x    #1642   +/-   ##
=======================================
  Coverage   83.26%   83.26%           
=======================================
  Files         707      707           
  Lines       19136    19136           
=======================================
  Hits        15934    15934           
  Misses       3202     3202           
Components Coverage Δ
etl 86.33% <ø> (ø)
cli 84.59% <ø> (ø)
lib-array-dot 94.53% <ø> (ø)
lib-azure-sdk 62.56% <ø> (ø)
lib-doctrine-dbal-bulk 90.11% <ø> (ø)
lib-filesystem 78.02% <ø> (ø)
lib-parquet 84.36% <ø> (ø)
lib-parquet-viewer 82.02% <ø> (ø)
lib-snappy 90.69% <ø> (ø)
bridge-filesystem-async-aws 90.38% <ø> (ø)
bridge-filesystem-azure 89.92% <ø> (ø)
bridge-monolog-http 96.38% <ø> (ø)
symfony-http-foundation 74.41% <ø> (ø)
adapter-chartjs 86.45% <ø> (ø)
adapter-csv 89.57% <ø> (ø)
adapter-doctrine 89.73% <ø> (ø)
adapter-elasticsearch 97.19% <ø> (ø)
adapter-google-sheet 80.00% <ø> (ø)
adapter-http 59.15% <ø> (ø)
adapter-json 90.62% <ø> (ø)
adapter-logger 53.84% <ø> (ø)
adapter-meilisearch 97.75% <ø> (ø)
adapter-parquet 80.85% <ø> (ø)
adapter-text 84.44% <ø> (ø)
adapter-xml 83.20% <ø> (ø)
🚀 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 c59e159 into flow-php:1.x May 10, 2025
22 checks passed
@stloyd stloyd deleted the rename-each-bench branch May 10, 2025 10:17
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