Skip to content

Conversation

@norberttech
Copy link
Member

@norberttech norberttech commented Nov 13, 2023

Change Log

Added

  • Extracted Flysystem dependency to standalone adapter

Fixed

Changed

Removed

Deprecated

Security


Description

Closes: #790

Recently @stloyd was playing a bit with using Flow in Sylius. Even though he had no intention of using remote filesystems, it was impossible to even install Flow due to a conflict in Guzzle dependency between Sylius and Flysystem.
To reduce the number of dependencies and make it even more flexible, Flysystem dependency was extracted to etl-filesystem-adapter which should be installed whenever remote filesystems access is required.

In order to make it work, I had to replace default FlysystemFS with LocalFilesystemFS - however PHP default glob function is not as advanced as we needed, so webmozart/glob dependency was introduced instead. webmozar/glob does not have any other dependencies so it should be way more less problematic than Flysystem.

@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           |
+-----------------------+-------------------+------+-----+------------------+-------------------+------------------+
| AvroExtractorBench    | bench_extract_10k | 1    | 3   | 35.269mb -0.01%  | 525.231ms +43.52% | ±0.36% -33.88%   |
| CSVExtractorBench     | bench_extract_10k | 1    | 3   | 4.920mb +0.08%   | 406.744ms +54.27% | ±1.36% +3190.06% |
| JsonExtractorBench    | bench_extract_10k | 1    | 3   | 5.028mb +0.08%   | 839.663ms +44.19% | ±0.40% -27.06%   |
| ParquetExtractorBench | bench_extract_10k | 1    | 3   | 239.725mb +0.00% | 1.171s +56.49%    | ±1.83% +355.39%  |
| TextExtractorBench    | bench_extract_10k | 1    | 3   | 4.854mb +0.08%   | 27.827ms +45.19%  | ±0.53% -76.90%   |
| XmlExtractorBench     | bench_extract_10k | 1    | 3   | 4.854mb +0.08%   | 668.343ms +66.62% | ±0.54% -35.21%   |
+-----------------------+-------------------+------+-----+------------------+-------------------+------------------+
Transformers
+-----------------------------+--------------------------+------+-----+-----------------+------------------+-----------------+
| benchmark                   | subject                  | revs | its | mem_peak        | mode             | rstdev          |
+-----------------------------+--------------------------+------+-----+-----------------+------------------+-----------------+
| RenameEntryTransformerBench | bench_transform_10k_rows | 1    | 3   | 87.114mb +0.00% | 85.112ms +75.71% | ±3.14% +220.93% |
+-----------------------------+--------------------------+------+-----+-----------------+------------------+-----------------+
Loaders
+--------------------+----------------+------+-----+------------------+-------------------+-----------------+
| benchmark          | subject        | revs | its | mem_peak         | mode              | rstdev          |
+--------------------+----------------+------+-----+------------------+-------------------+-----------------+
| AvroLoaderBench    | bench_load_10k | 1    | 3   | 95.302mb +0.00%  | 852.263ms +47.93% | ±1.05% +59.08%  |
| CSVLoaderBench     | bench_load_10k | 1    | 3   | 46.135mb +0.01%  | 81.491ms +17.51%  | ±1.80% +62.97%  |
| JsonLoaderBench    | bench_load_10k | 1    | 3   | 90.579mb +0.00%  | 90.578ms +46.16%  | ±3.19% +717.01% |
| ParquetLoaderBench | bench_load_10k | 1    | 3   | 292.421mb +0.00% | 2.650s +75.65%    | ±0.98% +200.57% |
| TextLoaderBench    | bench_load_10k | 1    | 3   | 16.629mb +0.02%  | 43.962ms +8.37%   | ±0.64% +32.84%  |
+--------------------+----------------+------+-----+------------------+-------------------+-----------------+
Building Blocks
+-------------------------+----------------------------+------+-----+-----------------+-------------------+-----------------+
| benchmark               | subject                    | revs | its | mem_peak        | mode              | rstdev          |
+-------------------------+----------------------------+------+-----+-----------------+-------------------+-----------------+
| RowsBench               | bench_chunk_10_on_10k      | 2    | 3   | 60.714mb +0.01% | 5.084ms +128.89%  | ±2.50% +3.36%   |
| RowsBench               | bench_diff_left_1k_on_10k  | 2    | 3   | 80.506mb +0.00% | 218.930ms +45.09% | ±2.10% +463.71% |
| RowsBench               | bench_diff_right_1k_on_10k | 2    | 3   | 59.032mb +0.01% | 21.357ms +42.44%  | ±0.34% -81.50%  |
| RowsBench               | bench_drop_1k_on_10k       | 2    | 3   | 59.852mb +0.01% | 3.511ms +100.50%  | ±1.73% +183.06% |
| RowsBench               | bench_drop_right_1k_on_10k | 2    | 3   | 59.852mb +0.01% | 3.571ms +100.34%  | ±2.02% +351.02% |
| RowsBench               | bench_entries_on_10k       | 2    | 3   | 59.066mb +0.01% | 4.576ms +72.76%   | ±1.32% +6.37%   |
| RowsBench               | bench_filter_on_10k        | 2    | 3   | 59.595mb +0.01% | 26.147ms +88.58%  | ±1.40% +211.73% |
| RowsBench               | bench_find_on_10k          | 2    | 3   | 59.594mb +0.01% | 26.564ms +90.73%  | ±0.58% -31.19%  |
| RowsBench               | bench_find_one_on_10k      | 10   | 3   | 57.665mb +0.01% | 2.506μs +38.76%   | ±1.86% -27.63%  |
| RowsBench               | bench_first_on_10k         | 10   | 3   | 57.665mb +0.01% | 0.500μs +25.00%   | ±0.00% -100.00% |
| RowsBench               | bench_flat_map_on_1k       | 2    | 3   | 65.899mb +0.01% | 16.478ms +60.43%  | ±2.13% +23.89%  |
| RowsBench               | bench_map_on_10k           | 2    | 3   | 91.419mb +0.00% | 72.451ms +52.53%  | ±0.37% +44.37%  |
| RowsBench               | bench_merge_1k_on_10k      | 2    | 3   | 60.115mb +0.01% | 3.687ms +87.67%   | ±3.43% +9.29%   |
| RowsBench               | bench_partition_by_on_10k  | 2    | 3   | 62.385mb +0.01% | 58.040ms +77.44%  | ±0.89% +10.77%  |
| RowsBench               | bench_remove_on_10k        | 2    | 3   | 62.216mb +0.01% | 9.753ms +106.40%  | ±2.03% +260.52% |
| RowsBench               | bench_sort_asc_on_1k       | 2    | 3   | 57.665mb +0.01% | 61.903ms +65.61%  | ±0.99% +11.08%  |
| RowsBench               | bench_sort_by_on_1k        | 2    | 3   | 57.665mb +0.01% | 62.306ms +68.57%  | ±1.86% +196.11% |
| RowsBench               | bench_sort_desc_on_1k      | 2    | 3   | 57.665mb +0.01% | 61.311ms +64.76%  | ±0.22% -25.14%  |
| RowsBench               | bench_sort_entries_on_1k   | 2    | 3   | 59.940mb +0.01% | 11.200ms +52.54%  | ±0.19% -87.15%  |
| RowsBench               | bench_sort_on_1k           | 2    | 3   | 57.665mb +0.01% | 45.705ms +60.70%  | ±0.92% -2.83%   |
| RowsBench               | bench_take_1k_on_10k       | 10   | 3   | 57.665mb +0.01% | 25.617μs +101.38% | ±0.85% -13.96%  |
| RowsBench               | bench_take_right_1k_on_10k | 10   | 3   | 57.665mb +0.01% | 31.940μs +104.47% | ±0.90% +12.31%  |
| RowsBench               | bench_unique_on_1k         | 2    | 3   | 80.507mb +0.00% | 213.756ms +36.33% | ±0.14% -90.43%  |
| NativeEntryFactoryBench | bench_entry_factory        | 1    | 3   | 93.723mb +0.01% | 183.071ms +50.22% | ±3.10% +743.60% |
| NativeEntryFactoryBench | bench_entry_factory        | 1    | 3   | 48.639mb +0.01% | 93.882ms +47.03%  | ±0.23% -88.53%  |
| NativeEntryFactoryBench | bench_entry_factory        | 1    | 3   | 12.661mb -0.03% | 22.904ms +58.87%  | ±1.00% -52.59%  |
+-------------------------+----------------------------+------+-----+-----------------+-------------------+-----------------+

@norberttech norberttech merged commit 8a73e17 into flow-php:1.x Nov 14, 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.

Extract Flysystem dependency to filesystem lib

2 participants