Skip to content

Conversation

@norberttech
Copy link
Member

Change Log

Added

  • concat_ws (with separator) scalar function

Fixed

Changed

Removed

Deprecated

Security


Description

@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   | 4.759mb +0.05%  | 541.237ms +0.45% | ±0.87% -14.38%  |
| JsonExtractorBench    | bench_extract_10k | 1    | 3   | 4.827mb +0.05%  | 1.059s +0.32%    | ±0.67% +31.55%  |
| ParquetExtractorBench | bench_extract_10k | 1    | 3   | 86.480mb +0.00% | 906.205ms -0.80% | ±0.54% +70.91%  |
| TextExtractorBench    | bench_extract_10k | 1    | 3   | 4.492mb +0.05%  | 33.724ms -1.14%  | ±0.63% -29.87%  |
| XmlExtractorBench     | bench_extract_10k | 1    | 3   | 4.469mb +0.05%  | 602.372ms +0.47% | ±0.97% +198.11% |
+-----------------------+-------------------+------+-----+-----------------+------------------+-----------------+
Transformers
+-----------------------------+--------------------------+------+-----+------------------+-----------------+-----------------+
| benchmark                   | subject                  | revs | its | mem_peak         | mode            | rstdev          |
+-----------------------------+--------------------------+------+-----+------------------+-----------------+-----------------+
| RenameEntryTransformerBench | bench_transform_10k_rows | 1    | 3   | 108.487mb +0.00% | 58.924ms -2.89% | ±1.17% +154.47% |
+-----------------------------+--------------------------+------+-----+------------------+-----------------+-----------------+
Loaders
+--------------------+----------------+------+-----+------------------+------------------+-----------------+
| benchmark          | subject        | revs | its | mem_peak         | mode             | rstdev          |
+--------------------+----------------+------+-----+------------------+------------------+-----------------+
| CSVLoaderBench     | bench_load_10k | 1    | 3   | 54.035mb +0.00%  | 100.313ms -0.79% | ±0.28% +168.53% |
| JsonLoaderBench    | bench_load_10k | 1    | 3   | 76.795mb +0.00%  | 92.971ms -0.70%  | ±0.92% +27.22%  |
| ParquetLoaderBench | bench_load_10k | 1    | 3   | 166.978mb +0.00% | 20.658s -0.77%   | ±0.21% -72.20%  |
| TextLoaderBench    | bench_load_10k | 1    | 3   | 17.079mb +0.01%  | 30.299ms -4.73%  | ±0.55% +86.95%  |
+--------------------+----------------+------+-----+------------------+------------------+-----------------+
Building Blocks
+-------------------------+----------------------------+------+-----+------------------+------------------+-----------------+
| benchmark               | subject                    | revs | its | mem_peak         | mode             | rstdev          |
+-------------------------+----------------------------+------+-----+------------------+------------------+-----------------+
| RowsBench               | bench_chunk_10_on_10k      | 2    | 3   | 80.252mb +0.00%  | 3.415ms -8.88%   | ±0.72% -76.13%  |
| RowsBench               | bench_diff_left_1k_on_10k  | 2    | 3   | 97.530mb +0.00%  | 192.056ms +0.86% | ±0.95% +110.34% |
| RowsBench               | bench_diff_right_1k_on_10k | 2    | 3   | 80.250mb +0.00%  | 19.460ms +2.33%  | ±1.08% +104.67% |
| RowsBench               | bench_drop_1k_on_10k       | 2    | 3   | 81.127mb +0.00%  | 1.779ms -5.19%   | ±2.94% +28.37%  |
| RowsBench               | bench_drop_right_1k_on_10k | 2    | 3   | 81.127mb +0.00%  | 1.954ms +4.00%   | ±1.87% -35.52%  |
| RowsBench               | bench_entries_on_10k       | 2    | 3   | 79.288mb +0.00%  | 3.710ms -9.07%   | ±0.19% -89.82%  |
| RowsBench               | bench_filter_on_10k        | 2    | 3   | 79.817mb +0.00%  | 15.073ms -3.97%  | ±0.24% -63.91%  |
| RowsBench               | bench_find_on_10k          | 2    | 3   | 79.817mb +0.00%  | 14.894ms -4.86%  | ±1.66% +387.54% |
| RowsBench               | bench_find_one_on_10k      | 10   | 3   | 78.508mb +0.00%  | 1.894μs -0.64%   | ±2.53% +3.57%   |
| RowsBench               | bench_first_on_10k         | 10   | 3   | 78.508mb +0.00%  | 0.300μs 0.00%    | ±0.00% 0.00%    |
| RowsBench               | bench_flat_map_on_1k       | 2    | 3   | 86.845mb +0.00%  | 12.677ms -2.40%  | ±0.53% -22.99%  |
| RowsBench               | bench_map_on_10k           | 2    | 3   | 114.193mb +0.00% | 60.369ms -3.09%  | ±0.10% -85.75%  |
| RowsBench               | bench_merge_1k_on_10k      | 2    | 3   | 80.336mb +0.00%  | 1.396ms -22.01%  | ±2.70% +514.62% |
| RowsBench               | bench_partition_by_on_10k  | 2    | 3   | 83.629mb +0.00%  | 60.425ms -6.98%  | ±0.36% -62.82%  |
| RowsBench               | bench_remove_on_10k        | 2    | 3   | 81.389mb +0.00%  | 3.886ms -4.68%   | ±1.04% -60.04%  |
| RowsBench               | bench_sort_asc_on_1k       | 2    | 3   | 78.792mb +0.00%  | 42.461ms -2.59%  | ±0.43% -51.59%  |
| RowsBench               | bench_sort_by_on_1k        | 2    | 3   | 78.792mb +0.00%  | 41.807ms -4.22%  | ±0.46% -68.27%  |
| RowsBench               | bench_sort_desc_on_1k      | 2    | 3   | 78.792mb +0.00%  | 42.196ms -3.43%  | ±1.11% +107.91% |
| RowsBench               | bench_sort_entries_on_1k   | 2    | 3   | 80.948mb +0.00%  | 8.211ms -1.95%   | ±0.79% -40.61%  |
| RowsBench               | bench_sort_on_1k           | 2    | 3   | 78.698mb +0.00%  | 29.183ms -1.59%  | ±0.21% -39.62%  |
| RowsBench               | bench_take_1k_on_10k       | 10   | 3   | 78.508mb +0.00%  | 13.735μs -9.04%  | ±3.01% +0.00%   |
| RowsBench               | bench_take_right_1k_on_10k | 10   | 3   | 78.508mb +0.00%  | 15.312μs -14.74% | ±0.61% -67.27%  |
| RowsBench               | bench_unique_on_1k         | 2    | 3   | 97.531mb +0.00%  | 195.563ms +0.84% | ±1.00% +40.27%  |
| NativeEntryFactoryBench | bench_entry_factory        | 1    | 3   | 98.643mb +0.00%  | 441.716ms +0.45% | ±1.54% +304.81% |
| NativeEntryFactoryBench | bench_entry_factory        | 1    | 3   | 51.474mb +0.00%  | 226.654ms +0.40% | ±0.84% +832.23% |
| NativeEntryFactoryBench | bench_entry_factory        | 1    | 3   | 13.646mb +0.02%  | 48.859ms +0.58%  | ±1.37% +7.99%   |
| TypeDetectorBench       | bench_type_detector        | 1    | 3   | 43.777mb +0.01%  | 362.923ms +0.25% | ±1.66% +411.01% |
| TypeDetectorBench       | bench_type_detector        | 1    | 3   | 11.587mb +0.02%  | 73.103ms -2.56%  | ±1.63% +3.97%   |
+-------------------------+----------------------------+------+-----+------------------+------------------+-----------------+

@codecov
Copy link

codecov bot commented Jan 17, 2025

Codecov Report

Attention: Patch coverage is 86.36364% with 3 lines in your changes missing coverage. Please review.

Project coverage is 82.51%. Comparing base (e0000ff) to head (4d46585).
Report is 2 commits behind head on 1.x.

Additional details and impacted files
@@            Coverage Diff             @@
##              1.x    #1385      +/-   ##
==========================================
- Coverage   82.51%   82.51%   -0.01%     
==========================================
  Files         648      649       +1     
  Lines       17395    17414      +19     
==========================================
+ Hits        14354    14369      +15     
- Misses       3041     3045       +4     
Components Coverage Δ
etl 85.82% <86.36%> (-0.01%) ⬇️
cli 85.17% <ø> (ø)
lib-array-dot 94.53% <ø> (ø)
lib-azure-sdk 62.56% <ø> (ø)
lib-doctrine-dbal-bulk 97.36% <ø> (ø)
lib-filesystem 76.23% <ø> (ø)
lib-parquet 84.57% <ø> (ø)
lib-parquet-viewer 82.02% <ø> (ø)
lib-rdsl 87.09% <ø> (ø)
lib-snappy 90.69% <ø> (-0.47%) ⬇️
bridge-filesystem-async-aws 90.38% <ø> (ø)
bridge-filesystem-azure 89.92% <ø> (ø)
bridge-monolog-http 96.38% <ø> (ø)
symfony-http-foundation 77.10% <ø> (ø)
adapter-chartjs 86.45% <ø> (ø)
adapter-csv 89.49% <ø> (ø)
adapter-doctrine 90.14% <ø> (ø)
adapter-elasticsearch 97.19% <ø> (ø)
adapter-google-sheet 78.04% <ø> (ø)
adapter-http 59.15% <ø> (ø)
adapter-json 92.85% <ø> (ø)
adapter-logger 53.84% <ø> (ø)
adapter-meilisearch 97.75% <ø> (ø)
adapter-parquet 59.88% <ø> (ø)
adapter-text 84.44% <ø> (ø)
adapter-xml 83.15% <ø> (ø)

@norberttech norberttech merged commit 386ed87 into flow-php:1.x Jan 17, 2025
23 checks passed
Comment on lines +36 to +38
if (\count($concatValues) === 0) {
return '';
}
Copy link
Member

Choose a reason for hiding this comment

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

This can be ommited as the implode should handle an empty array

}
}

if (\count($concatValues) === 0) {
Copy link
Member

Choose a reason for hiding this comment

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

Same, as for concat.

return '';
}

$values = \array_map(fn (ScalarFunction|string $string) : mixed => \is_string($string) ? $string : Caster::default()->to(type_string(true))->value($string->eval($row)), $this->refs);
Copy link
Member

Choose a reason for hiding this comment

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

Instead of map, it could be merged into below loop, so it won't be doing two loops over given values.

Copy link
Member

Choose a reason for hiding this comment

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

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