Skip to content

Conversation

@norberttech
Copy link
Member

Change Log

Added

Fixed

Changed

  • Expression is now ScalarFunction
  • Aggregator is now AggregationFunction

Removed

  • struct reference

Deprecated

Security


Description

All expressions are now moved under Function namespace, so we have 3 types of functions:

  • ScalarFunction - previously expressions
  • AggregationFunctions - previously Aggregators
  • WindowFunctions - previously also WindowFunctions

Window functions were completely redesigned to work just like they work in SQL

dens_rank()->over(window()->partitionBy(ref('department'))->orderBy(ref('salary')->desc()))

@github-actions
Copy link
Contributor

github-actions bot commented Nov 17, 2023

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         |
+-----------------------+-------------------+------+-----+------------------+------------------+----------------+
| AvroExtractorBench    | bench_extract_10k | 1    | 3   | 34.753mb -0.01%  | 1.144s -1.48%    | ±1.41% +21.39% |
| CSVExtractorBench     | bench_extract_10k | 1    | 3   | 4.610mb -0.09%   | 301.433ms -0.76% | ±0.31% -21.14% |
| JsonExtractorBench    | bench_extract_10k | 1    | 3   | 4.777mb -0.09%   | 1.383s -0.71%    | ±0.33% -48.97% |
| ParquetExtractorBench | bench_extract_10k | 1    | 3   | 239.482mb -0.00% | 1.575s +0.25%    | ±1.10% +51.14% |
| TextExtractorBench    | bench_extract_10k | 1    | 3   | 4.564mb -0.13%   | 24.170ms -0.45%  | ±0.87% +4.42%  |
| XmlExtractorBench     | bench_extract_10k | 1    | 3   | 4.564mb -0.13%   | 408.920ms +0.79% | ±0.62% -8.31%  |
+-----------------------+-------------------+------+-----+------------------+------------------+----------------+
Transformers
+-----------------------------+--------------------------+------+-----+------------------+-----------------+----------------+
| benchmark                   | subject                  | revs | its | mem_peak         | mode            | rstdev         |
+-----------------------------+--------------------------+------+-----+------------------+-----------------+----------------+
| RenameEntryTransformerBench | bench_transform_10k_rows | 1    | 3   | 110.254mb -0.00% | 64.839ms -1.13% | ±0.49% -79.64% |
+-----------------------------+--------------------------+------+-----+------------------+-----------------+----------------+
Loaders
+--------------------+----------------+------+-----+------------------+------------------+-----------------+
| benchmark          | subject        | revs | its | mem_peak         | mode             | rstdev          |
+--------------------+----------------+------+-----+------------------+------------------+-----------------+
| AvroLoaderBench    | bench_load_10k | 1    | 3   | 94.734mb -0.00%  | 434.447ms -2.75% | ±0.71% -46.36%  |
| CSVLoaderBench     | bench_load_10k | 1    | 3   | 54.650mb +0.11%  | 70.674ms +0.10%  | ±0.96% +325.53% |
| JsonLoaderBench    | bench_load_10k | 1    | 3   | 105.317mb -0.00% | 55.185ms +0.41%  | ±1.70% -11.15%  |
| ParquetLoaderBench | bench_load_10k | 1    | 3   | 320.789mb -0.00% | 1.395s -1.69%    | ±0.26% -48.98%  |
| TextLoaderBench    | bench_load_10k | 1    | 3   | 17.594mb -0.02%  | 40.336ms -0.86%  | ±0.32% -84.69%  |
+--------------------+----------------+------+-----+------------------+------------------+-----------------+
Building Blocks
+-------------------------+----------------------------+------+-----+------------------+------------------+------------------+
| benchmark               | subject                    | revs | its | mem_peak         | mode             | rstdev           |
+-------------------------+----------------------------+------+-----+------------------+------------------+------------------+
| RowsBench               | bench_chunk_10_on_10k      | 2    | 3   | 76.300mb -0.00%  | 2.488ms +14.33%  | ±0.79% -78.77%   |
| RowsBench               | bench_diff_left_1k_on_10k  | 2    | 3   | 96.092mb -0.01%  | 180.233ms +0.02% | ±0.28% -25.89%   |
| RowsBench               | bench_diff_right_1k_on_10k | 2    | 3   | 74.618mb -0.01%  | 17.990ms -0.23%  | ±0.40% -36.81%   |
| RowsBench               | bench_drop_1k_on_10k       | 2    | 3   | 75.438mb -0.00%  | 1.859ms +15.44%  | ±2.28% -28.43%   |
| RowsBench               | bench_drop_right_1k_on_10k | 2    | 3   | 75.438mb -0.00%  | 1.869ms +13.17%  | ±0.44% -80.63%   |
| RowsBench               | bench_entries_on_10k       | 2    | 3   | 74.652mb -0.01%  | 2.723ms +7.37%   | ±0.83% +13.53%   |
| RowsBench               | bench_filter_on_10k        | 2    | 3   | 75.181mb -0.00%  | 15.280ms +6.64%  | ±0.12% -90.99%   |
| RowsBench               | bench_find_on_10k          | 2    | 3   | 75.180mb -0.00%  | 14.838ms +5.89%  | ±1.48% +33.50%   |
| RowsBench               | bench_find_one_on_10k      | 10   | 3   | 73.084mb -0.01%  | 1.794μs -0.67%   | ±2.67% +3.77%    |
| RowsBench               | bench_first_on_10k         | 10   | 3   | 73.084mb -0.01%  | 0.300μs 0.00%    | ±0.00% 0.00%     |
| RowsBench               | bench_flat_map_on_1k       | 2    | 3   | 86.642mb -0.00%  | 13.174ms +1.84%  | ±1.82% +109.39%  |
| RowsBench               | bench_map_on_10k           | 2    | 3   | 115.999mb -0.00% | 64.529ms +0.15%  | ±0.80% +31.28%   |
| RowsBench               | bench_merge_1k_on_10k      | 2    | 3   | 75.701mb -0.00%  | 1.948ms +7.86%   | ±2.42% +108.39%  |
| RowsBench               | bench_partition_by_on_10k  | 2    | 3   | 77.971mb -0.01%  | 34.323ms +7.66%  | ±0.40% +57.44%   |
| RowsBench               | bench_remove_on_10k        | 2    | 3   | 77.802mb -0.00%  | 4.415ms +0.36%   | ±3.19% +587.75%  |
| RowsBench               | bench_sort_asc_on_1k       | 2    | 3   | 73.228mb -0.01%  | 38.189ms +3.53%  | ±0.68% +1026.39% |
| RowsBench               | bench_sort_by_on_1k        | 2    | 3   | 73.229mb -0.01%  | 38.275ms +3.59%  | ±0.21% -26.01%   |
| RowsBench               | bench_sort_desc_on_1k      | 2    | 3   | 73.228mb -0.01%  | 38.654ms +4.43%  | ±0.65% -48.45%   |
| RowsBench               | bench_sort_entries_on_1k   | 2    | 3   | 75.526mb -0.00%  | 7.444ms +1.02%   | ±0.71% +50.93%   |
| RowsBench               | bench_sort_on_1k           | 2    | 3   | 73.083mb -0.01%  | 28.545ms +0.09%  | ±0.49% -38.80%   |
| RowsBench               | bench_take_1k_on_10k       | 10   | 3   | 73.084mb -0.01%  | 13.300μs +2.57%  | ±0.61% -61.06%   |
| RowsBench               | bench_take_right_1k_on_10k | 10   | 3   | 73.084mb -0.01%  | 15.493μs -0.84%  | ±1.97% +64.63%   |
| RowsBench               | bench_unique_on_1k         | 2    | 3   | 96.093mb -0.01%  | 181.981ms -0.13% | ±0.89% +75.98%   |
| NativeEntryFactoryBench | bench_entry_factory        | 1    | 3   | 115.846mb -0.00% | 757.260ms +0.73% | ±0.50% -65.31%   |
| NativeEntryFactoryBench | bench_entry_factory        | 1    | 3   | 59.564mb -0.01%  | 386.423ms +0.06% | ±0.42% -28.86%   |
| NativeEntryFactoryBench | bench_entry_factory        | 1    | 3   | 14.687mb -0.03%  | 79.172ms -0.16%  | ±0.70% +73.78%   |
+-------------------------+----------------------------+------+-----+------------------+------------------+------------------+

@norberttech norberttech merged commit 70a759e into flow-php:1.x Nov 17, 2023
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.

1 participant