Skip to content

Fixed Cache ExternalSort algorithm implementation#1119

Merged
norberttech merged 1 commit intoflow-php:1.xfrom
norberttech:bug/external-sort-cache-implementation
Jul 17, 2024
Merged

Fixed Cache ExternalSort algorithm implementation#1119
norberttech merged 1 commit intoflow-php:1.xfrom
norberttech:bug/external-sort-cache-implementation

Conversation

@norberttech
Copy link
Member

@norberttech norberttech commented Jul 17, 2024

Change Log

Added

Fixed

  • RowsMinSort ASC/DESC sorting
  • RowsMinSort non numeric values sorting

Changed

Removed

Deprecated

Security


Description

Resolves: #1116

@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   | 3.915mb +0.02%  | 509.539ms +8.31%  | ±0.24% -17.84% |
| JsonExtractorBench    | bench_extract_10k | 1    | 3   | 3.948mb +0.02%  | 1.065s +5.83%     | ±0.43% -48.66% |
| ParquetExtractorBench | bench_extract_10k | 1    | 3   | 28.508mb +0.00% | 429.575ms +10.23% | ±0.20% -49.55% |
| TextExtractorBench    | bench_extract_10k | 1    | 3   | 3.675mb +0.03%  | 33.834ms +7.65%   | ±0.87% -71.31% |
| XmlExtractorBench     | bench_extract_10k | 1    | 3   | 3.622mb +0.03%  | 435.074ms +8.69%  | ±1.07% +54.10% |
+-----------------------+-------------------+------+-----+-----------------+-------------------+----------------+
Transformers
+-----------------------------+--------------------------+------+-----+------------------+------------------+----------------+
| benchmark                   | subject                  | revs | its | mem_peak         | mode             | rstdev         |
+-----------------------------+--------------------------+------+-----+------------------+------------------+----------------+
| RenameEntryTransformerBench | bench_transform_10k_rows | 1    | 3   | 115.968mb +0.00% | 60.534ms +10.19% | ±1.14% -18.13% |
+-----------------------------+--------------------------+------+-----+------------------+------------------+----------------+
Loaders
+--------------------+----------------+------+-----+------------------+------------------+-----------------+
| benchmark          | subject        | revs | its | mem_peak         | mode             | rstdev          |
+--------------------+----------------+------+-----+------------------+------------------+-----------------+
| CSVLoaderBench     | bench_load_10k | 1    | 3   | 54.070mb +0.00%  | 85.073ms +6.81%  | ±0.10% -96.03%  |
| JsonLoaderBench    | bench_load_10k | 1    | 3   | 106.503mb +0.00% | 53.422ms +11.26% | ±0.56% +55.09%  |
| ParquetLoaderBench | bench_load_10k | 1    | 3   | 123.785mb +0.00% | 1.254s +10.45%   | ±0.79% +495.53% |
| TextLoaderBench    | bench_load_10k | 1    | 3   | 16.864mb +0.01%  | 44.788ms +11.75% | ±0.32% -67.76%  |
+--------------------+----------------+------+-----+------------------+------------------+-----------------+
Building Blocks
+-------------------------+----------------------------+------+-----+------------------+-------------------+-----------------+
| benchmark               | subject                    | revs | its | mem_peak         | mode              | rstdev          |
+-------------------------+----------------------------+------+-----+------------------+-------------------+-----------------+
| TypeDetectorBench       | bench_type_detector        | 1    | 3   | 59.696mb +0.00%  | 448.239ms +13.94% | ±2.10% +124.69% |
| TypeDetectorBench       | bench_type_detector        | 1    | 3   | 14.236mb +0.01%  | 88.790ms +11.33%  | ±1.94% +65.71%  |
| NativeEntryFactoryBench | bench_entry_factory        | 1    | 3   | 116.518mb +0.00% | 493.112ms +7.09%  | ±1.00% +159.35% |
| NativeEntryFactoryBench | bench_entry_factory        | 1    | 3   | 59.996mb +0.00%  | 246.105ms +5.30%  | ±0.52% -32.65%  |
| NativeEntryFactoryBench | bench_entry_factory        | 1    | 3   | 14.930mb +0.01%  | 54.491ms +8.00%   | ±0.71% -44.07%  |
| RowsBench               | bench_chunk_10_on_10k      | 2    | 3   | 86.788mb +0.00%  | 3.539ms +20.85%   | ±3.27% +346.75% |
| RowsBench               | bench_diff_left_1k_on_10k  | 2    | 3   | 102.386mb +0.00% | 188.936ms +7.32%  | ±0.73% -18.98%  |
| RowsBench               | bench_diff_right_1k_on_10k | 2    | 3   | 85.106mb +0.00%  | 19.045ms +9.27%   | ±0.99% +102.62% |
| RowsBench               | bench_drop_1k_on_10k       | 2    | 3   | 88.027mb +0.00%  | 2.159ms +41.52%   | ±1.91% -40.26%  |
| RowsBench               | bench_drop_right_1k_on_10k | 2    | 3   | 88.027mb +0.00%  | 2.265ms +55.40%   | ±2.11% +55.80%  |
| RowsBench               | bench_entries_on_10k       | 2    | 3   | 85.140mb +0.00%  | 2.894ms +24.49%   | ±1.18% +0.35%   |
| RowsBench               | bench_filter_on_10k        | 2    | 3   | 85.669mb +0.00%  | 16.406ms +12.59%  | ±1.47% +9.15%   |
| RowsBench               | bench_find_on_10k          | 2    | 3   | 85.669mb +0.00%  | 16.667ms +12.41%  | ±0.81% -40.21%  |
| RowsBench               | bench_find_one_on_10k      | 10   | 3   | 83.573mb +0.00%  | 1.994μs +32.93%   | ±2.40% +0.00%   |
| RowsBench               | bench_first_on_10k         | 10   | 3   | 83.573mb +0.00%  | 0.400μs +100.00%  | ±0.00% 0.00%    |
| RowsBench               | bench_flat_map_on_1k       | 2    | 3   | 92.923mb +0.00%  | 13.585ms +19.56%  | ±1.93% +80.58%  |
| RowsBench               | bench_map_on_10k           | 2    | 3   | 122.293mb +0.00% | 63.402ms +13.45%  | ±0.94% +9.18%   |
| RowsBench               | bench_merge_1k_on_10k      | 2    | 3   | 86.188mb +0.00%  | 2.014ms +81.42%   | ±2.07% +10.07%  |
| RowsBench               | bench_partition_by_on_10k  | 2    | 3   | 89.535mb +0.00%  | 60.221ms +11.04%  | ±0.12% +3.66%   |
| RowsBench               | bench_remove_on_10k        | 2    | 3   | 88.290mb +0.00%  | 4.617ms +30.81%   | ±0.73% -13.33%  |
| RowsBench               | bench_sort_asc_on_1k       | 2    | 3   | 83.716mb +0.00%  | 39.882ms +11.46%  | ±0.55% -41.65%  |
| RowsBench               | bench_sort_by_on_1k        | 2    | 3   | 83.717mb +0.00%  | 39.621ms +9.46%   | ±0.53% -56.72%  |
| RowsBench               | bench_sort_desc_on_1k      | 2    | 3   | 83.716mb +0.00%  | 40.115ms +12.77%  | ±2.29% +10.53%  |
| RowsBench               | bench_sort_entries_on_1k   | 2    | 3   | 86.014mb +0.00%  | 7.524ms +8.87%    | ±0.13% -95.16%  |
| RowsBench               | bench_sort_on_1k           | 2    | 3   | 83.573mb +0.00%  | 29.445ms +11.63%  | ±1.85% +631.77% |
| RowsBench               | bench_take_1k_on_10k       | 10   | 3   | 83.573mb +0.00%  | 14.234μs +15.78%  | ±1.45% +277.43% |
| RowsBench               | bench_take_right_1k_on_10k | 10   | 3   | 83.573mb +0.00%  | 16.256μs +12.25%  | ±2.25% +129.53% |
| RowsBench               | bench_unique_on_1k         | 2    | 3   | 102.387mb +0.00% | 190.064ms +8.22%  | ±0.69% +61.42%  |
+-------------------------+----------------------------+------+-----+------------------+-------------------+-----------------+

@norberttech norberttech merged commit 5d13945 into flow-php:1.x Jul 17, 2024
@norberttech norberttech deleted the bug/external-sort-cache-implementation branch December 5, 2024 20:19
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.

Sorting by column works in opposite way when external sort exceeds allowed memory

1 participant