Skip to content

Conversation

@norberttech
Copy link
Member

Change Log

Added

Fixed

  • Prevent reading multiple times from the same partitioning cache

Changed

Removed

Deprecated

Security


Description

private function cachePath(string $id) : string
{
return \rtrim($this->path, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . \hash('xxh128', $id);
return \rtrim($this->path, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . $id;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no other cache implementation is doing hash here

@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   | 34.757mb +0.00%  | 685.246ms +2.81% | ±0.65% -77.28% |
| CSVExtractorBench     | bench_extract_10k | 1    | 3   | 4.621mb +0.00%   | 296.475ms -0.44% | ±0.42% -37.43% |
| JsonExtractorBench    | bench_extract_10k | 1    | 3   | 4.781mb +0.00%   | 925.822ms +2.18% | ±0.28% -9.35%  |
| ParquetExtractorBench | bench_extract_10k | 1    | 3   | 239.490mb +0.00% | 1.107s +0.73%    | ±0.33% -12.97% |
| TextExtractorBench    | bench_extract_10k | 1    | 3   | 4.560mb +0.00%   | 24.097ms +1.51%  | ±1.23% -34.98% |
| XmlExtractorBench     | bench_extract_10k | 1    | 3   | 4.561mb +0.00%   | 402.807ms -0.91% | ±0.12% -90.80% |
+-----------------------+-------------------+------+-----+------------------+------------------+----------------+
Transformers
+-----------------------------+--------------------------+------+-----+------------------+-----------------+-----------------+
| benchmark                   | subject                  | revs | its | mem_peak         | mode            | rstdev          |
+-----------------------------+--------------------------+------+-----+------------------+-----------------+-----------------+
| RenameEntryTransformerBench | bench_transform_10k_rows | 1    | 3   | 110.246mb +0.00% | 64.240ms +5.79% | ±1.98% +371.94% |
+-----------------------------+--------------------------+------+-----+------------------+-----------------+-----------------+
Loaders
+--------------------+----------------+------+-----+------------------+------------------+------------------+
| benchmark          | subject        | revs | its | mem_peak         | mode             | rstdev           |
+--------------------+----------------+------+-----+------------------+------------------+------------------+
| AvroLoaderBench    | bench_load_10k | 1    | 3   | 94.417mb +0.00%  | 439.226ms -0.48% | ±1.55% +1113.80% |
| CSVLoaderBench     | bench_load_10k | 1    | 3   | 54.727mb +0.00%  | 72.287ms +0.81%  | ±0.90% -14.93%   |
| JsonLoaderBench    | bench_load_10k | 1    | 3   | 104.999mb +0.00% | 55.721ms +2.12%  | ±1.86% -8.94%    |
| ParquetLoaderBench | bench_load_10k | 1    | 3   | 320.477mb +0.00% | 1.484s +1.73%    | ±0.50% +316.90%  |
| TextLoaderBench    | bench_load_10k | 1    | 3   | 17.601mb +0.00%  | 41.087ms +0.66%  | ±0.47% +159.72%  |
+--------------------+----------------+------+-----+------------------+------------------+------------------+
Building Blocks
+-------------------------+----------------------------+------+-----+------------------+------------------+-----------------+
| benchmark               | subject                    | revs | its | mem_peak         | mode             | rstdev          |
+-------------------------+----------------------------+------+-----+------------------+------------------+-----------------+
| RowsBench               | bench_chunk_10_on_10k      | 2    | 3   | 76.300mb +0.00%  | 2.652ms +0.61%   | ±1.34% +51.59%  |
| RowsBench               | bench_diff_left_1k_on_10k  | 2    | 3   | 96.091mb +0.00%  | 175.372ms +0.32% | ±0.60% +21.88%  |
| RowsBench               | bench_diff_right_1k_on_10k | 2    | 3   | 74.617mb +0.00%  | 17.663ms -0.18%  | ±0.07% -94.62%  |
| RowsBench               | bench_drop_1k_on_10k       | 2    | 3   | 77.540mb +0.00%  | 1.728ms +2.97%   | ±0.78% -15.43%  |
| RowsBench               | bench_drop_right_1k_on_10k | 2    | 3   | 77.540mb +0.00%  | 1.855ms +9.19%   | ±3.60% +28.27%  |
| RowsBench               | bench_entries_on_10k       | 2    | 3   | 74.653mb +0.00%  | 2.543ms -5.87%   | ±1.55% -28.92%  |
| RowsBench               | bench_filter_on_10k        | 2    | 3   | 75.181mb +0.00%  | 14.446ms +2.55%  | ±0.75% -35.21%  |
| RowsBench               | bench_find_on_10k          | 2    | 3   | 75.181mb +0.00%  | 14.630ms +5.17%  | ±1.01% +182.78% |
| RowsBench               | bench_find_one_on_10k      | 10   | 3   | 73.084mb +0.00%  | 1.806μs +5.86%   | ±2.57% -5.45%   |
| RowsBench               | bench_first_on_10k         | 10   | 3   | 73.084mb +0.00%  | 0.400μs +33.33%  | ±0.00% +0.00%   |
| RowsBench               | bench_flat_map_on_1k       | 2    | 3   | 86.641mb +0.00%  | 12.555ms +4.12%  | ±1.52% -23.74%  |
| RowsBench               | bench_map_on_10k           | 2    | 3   | 116.001mb +0.00% | 63.095ms +2.91%  | ±2.69% +171.92% |
| RowsBench               | bench_merge_1k_on_10k      | 2    | 3   | 75.702mb +0.00%  | 1.847ms +4.65%   | ±2.66% +777.97% |
| RowsBench               | bench_partition_by_on_10k  | 2    | 3   | 77.968mb +0.00%  | 34.802ms +5.23%  | ±2.36% +30.77%  |
| RowsBench               | bench_remove_on_10k        | 2    | 3   | 77.802mb +0.00%  | 3.790ms -0.37%   | ±1.11% +78.50%  |
| RowsBench               | bench_sort_asc_on_1k       | 2    | 3   | 73.227mb +0.00%  | 38.027ms -1.44%  | ±2.44% +331.32% |
| RowsBench               | bench_sort_by_on_1k        | 2    | 3   | 73.228mb +0.00%  | 38.296ms -0.31%  | ±1.14% +8.36%   |
| RowsBench               | bench_sort_desc_on_1k      | 2    | 3   | 73.227mb +0.00%  | 38.226ms -0.65%  | ±1.79% +71.12%  |
| RowsBench               | bench_sort_entries_on_1k   | 2    | 3   | 75.527mb +0.00%  | 7.292ms -0.62%   | ±0.94% +173.12% |
| RowsBench               | bench_sort_on_1k           | 2    | 3   | 73.084mb +0.00%  | 28.956ms +1.83%  | ±2.04% +759.48% |
| RowsBench               | bench_take_1k_on_10k       | 10   | 3   | 73.084mb +0.00%  | 13.182μs -1.32%  | ±1.08% -41.72%  |
| RowsBench               | bench_take_right_1k_on_10k | 10   | 3   | 73.084mb +0.00%  | 15.888μs -0.63%  | ±0.60% +0.63%   |
| RowsBench               | bench_unique_on_1k         | 2    | 3   | 96.092mb +0.00%  | 182.870ms +2.62% | ±0.58% -19.46%  |
| TypeDetectorBench       | bench_type_detector        | 1    | 3   | 59.173mb +0.00%  | 326.836ms -0.39% | ±0.48% -24.43%  |
| TypeDetectorBench       | bench_type_detector        | 1    | 3   | 14.096mb +0.00%  | 64.999ms +1.40%  | ±3.43% +380.68% |
| NativeEntryFactoryBench | bench_entry_factory        | 1    | 3   | 115.843mb +0.00% | 365.869ms -1.26% | ±1.20% +15.56%  |
| NativeEntryFactoryBench | bench_entry_factory        | 1    | 3   | 59.561mb +0.00%  | 185.063ms -2.41% | ±1.58% -11.71%  |
| NativeEntryFactoryBench | bench_entry_factory        | 1    | 3   | 14.686mb +0.00%  | 40.108ms +1.64%  | ±1.68% +46.21%  |
+-------------------------+----------------------------+------+-----+------------------+------------------+-----------------+

@norberttech norberttech merged commit a5e6af8 into flow-php:1.x Nov 21, 2023
@norberttech norberttech deleted the bug/partitioning-pipeline-bug branch December 5, 2024 20:21
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