Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unify passing options to Loaders/Extractors #1207

Merged
merged 1 commit into from
Sep 5, 2024
Merged

Conversation

mleczakm
Copy link
Contributor

@mleczakm mleczakm commented Sep 4, 2024

Change Log

Changed

  • from_csv, from_json, from_xml, from_parquet and from_text contract, removed support for passing path as array

Description

See #1204

Copy link
Contributor

github-actions bot commented Sep 4, 2024

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.519mb -0.13%  | 508.811ms -0.43% | ±0.11% -45.93% |
| JsonExtractorBench    | bench_extract_10k | 1    | 3   | 4.586mb -0.13%  | 1.058s -1.45%    | ±1.31% +58.15% |
| ParquetExtractorBench | bench_extract_10k | 1    | 3   | 29.092mb -0.02% | 430.189ms -1.16% | ±0.16% -78.43% |
| TextExtractorBench    | bench_extract_10k | 1    | 3   | 4.279mb -0.14%  | 34.255ms -0.09%  | ±1.12% -31.36% |
| XmlExtractorBench     | bench_extract_10k | 1    | 3   | 4.269mb -0.14%  | 783.080ms +2.36% | ±2.44% +32.21% |
+-----------------------+-------------------+------+-----+-----------------+------------------+----------------+
Transformers
+-----------------------------+--------------------------+------+-----+------------------+-----------------+----------------+
| benchmark                   | subject                  | revs | its | mem_peak         | mode            | rstdev         |
+-----------------------------+--------------------------+------+-----+------------------+-----------------+----------------+
| RenameEntryTransformerBench | bench_transform_10k_rows | 1    | 3   | 116.555mb -0.01% | 60.742ms -0.09% | ±0.79% -45.74% |
+-----------------------------+--------------------------+------+-----+------------------+-----------------+----------------+
Loaders
+--------------------+----------------+------+-----+------------------+------------------+-----------------+
| benchmark          | subject        | revs | its | mem_peak         | mode             | rstdev          |
+--------------------+----------------+------+-----+------------------+------------------+-----------------+
| CSVLoaderBench     | bench_load_10k | 1    | 3   | 54.715mb -0.01%  | 140.378ms -0.55% | ±0.60% -47.15%  |
| JsonLoaderBench    | bench_load_10k | 1    | 3   | 90.328mb -0.01%  | 115.697ms -0.78% | ±0.27% -61.55%  |
| ParquetLoaderBench | bench_load_10k | 1    | 3   | 124.380mb -0.00% | 1.232s +0.05%    | ±0.31% +19.51%  |
| TextLoaderBench    | bench_load_10k | 1    | 3   | 17.470mb -0.03%  | 43.880ms -0.83%  | ±1.04% +110.49% |
+--------------------+----------------+------+-----+------------------+------------------+-----------------+
Building Blocks
+-------------------------+----------------------------+------+-----+------------------+------------------+------------------+
| benchmark               | subject                    | revs | its | mem_peak         | mode             | rstdev           |
+-------------------------+----------------------------+------+-----+------------------+------------------+------------------+
| NativeEntryFactoryBench | bench_entry_factory        | 1    | 3   | 107.398mb -0.01% | 463.711ms -0.54% | ±0.88% +11.58%   |
| NativeEntryFactoryBench | bench_entry_factory        | 1    | 3   | 55.756mb -0.01%  | 236.366ms -0.77% | ±0.45% -65.44%   |
| NativeEntryFactoryBench | bench_entry_factory        | 1    | 3   | 14.594mb -0.04%  | 51.025ms -0.91%  | ±0.94% -8.19%    |
| RowsBench               | bench_chunk_10_on_10k      | 2    | 3   | 87.311mb -0.01%  | 3.371ms -6.66%   | ±0.64% -46.14%   |
| RowsBench               | bench_diff_left_1k_on_10k  | 2    | 3   | 102.915mb -0.01% | 186.388ms -1.97% | ±0.79% -3.48%    |
| RowsBench               | bench_diff_right_1k_on_10k | 2    | 3   | 85.635mb -0.01%  | 18.466ms -3.31%  | ±0.07% -90.65%   |
| RowsBench               | bench_drop_1k_on_10k       | 2    | 3   | 88.551mb -0.01%  | 1.718ms -16.59%  | ±0.35% +0.78%    |
| RowsBench               | bench_drop_right_1k_on_10k | 2    | 3   | 88.551mb -0.01%  | 1.778ms -11.16%  | ±3.50% +721.13%  |
| RowsBench               | bench_entries_on_10k       | 2    | 3   | 85.664mb -0.01%  | 2.851ms -6.55%   | ±1.04% +91.20%   |
| RowsBench               | bench_filter_on_10k        | 2    | 3   | 86.192mb -0.01%  | 16.635ms +0.16%  | ±1.28% -4.94%    |
| RowsBench               | bench_find_on_10k          | 2    | 3   | 86.192mb -0.01%  | 16.620ms +0.67%  | ±1.83% -1.54%    |
| RowsBench               | bench_find_one_on_10k      | 10   | 3   | 84.096mb -0.01%  | 1.606μs -10.77%  | ±2.89% +0.00%    |
| RowsBench               | bench_first_on_10k         | 10   | 3   | 84.096mb -0.01%  | 0.300μs -25.00%  | ±0.00% -100.00%  |
| RowsBench               | bench_flat_map_on_1k       | 2    | 3   | 93.447mb -0.01%  | 12.438ms -1.92%  | ±0.58% -65.81%   |
| RowsBench               | bench_map_on_10k           | 2    | 3   | 122.817mb -0.00% | 61.522ms +0.09%  | ±1.32% +311.72%  |
| RowsBench               | bench_merge_1k_on_10k      | 2    | 3   | 86.712mb -0.01%  | 1.562ms -13.84%  | ±0.71% -44.96%   |
| RowsBench               | bench_partition_by_on_10k  | 2    | 3   | 90.068mb -0.01%  | 65.692ms +10.18% | ±2.32% +239.49%  |
| RowsBench               | bench_remove_on_10k        | 2    | 3   | 88.814mb -0.01%  | 4.267ms -7.30%   | ±3.16% +5447.06% |
| RowsBench               | bench_sort_asc_on_1k       | 2    | 3   | 84.246mb -0.01%  | 38.544ms -0.82%  | ±0.83% +80.70%   |
| RowsBench               | bench_sort_by_on_1k        | 2    | 3   | 84.247mb -0.01%  | 39.077ms -2.13%  | ±0.54% -62.46%   |
| RowsBench               | bench_sort_desc_on_1k      | 2    | 3   | 84.246mb -0.01%  | 38.720ms -2.67%  | ±0.97% -7.55%    |
| RowsBench               | bench_sort_entries_on_1k   | 2    | 3   | 86.538mb -0.01%  | 7.243ms -1.93%   | ±0.71% -55.76%   |
| RowsBench               | bench_sort_on_1k           | 2    | 3   | 84.096mb -0.01%  | 28.969ms -0.35%  | ±1.07% +23.05%   |
| RowsBench               | bench_take_1k_on_10k       | 10   | 3   | 84.096mb -0.01%  | 13.488μs -2.96%  | ±0.70% -72.19%   |
| RowsBench               | bench_take_right_1k_on_10k | 10   | 3   | 84.096mb -0.01%  | 15.888μs -1.28%  | ±1.64% +457.93%  |
| RowsBench               | bench_unique_on_1k         | 2    | 3   | 102.917mb -0.01% | 190.419ms +0.05% | ±0.28% -88.23%   |
| TypeDetectorBench       | bench_type_detector        | 1    | 3   | 53.201mb -0.01%  | 388.723ms -1.36% | ±3.35% +2662.47% |
| TypeDetectorBench       | bench_type_detector        | 1    | 3   | 13.467mb -0.05%  | 78.009ms -1.75%  | ±0.02% -99.12%   |
+-------------------------+----------------------------+------+-----+------------------+------------------+------------------+

@norberttech
Copy link
Member

Since its a rather significant BC Break, could you mention it in UPGRADE.md?

@norberttech norberttech merged commit adf86f1 into flow-php:1.x Sep 5, 2024
26 checks passed
@norberttech
Copy link
Member

Since its a rather significant BC Break, could you mention it in UPGRADE.md?

Covered in #1208

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