Skip to content

[GLUTEN-2723][CH] Improve Broadcast Join performance -- Part 3 - #4231

Merged
baibaichen merged 1 commit into
apache:mainfrom
baibaichen:feature/broadcast_opt
Jan 2, 2024
Merged

baibaichen merged 1 commit into
apache:mainfrom
baibaichen:feature/broadcast_opt

Conversation

@baibaichen

@baibaichen baibaichen commented Dec 29, 2023 •

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

This PR has two improvements:

  1. Instead of utilizing the ShuffleInputStream, it is advantageous to directly copy memory from the Java array for small broadcast scenarios.
  2. For larger broadcasts, it is beneficial to allocate hashmap size based on the broadcast size.

However, there is no significant enhancement observed in end-to-end performance. Nevertheless, let us merge as it did the appropriate work.

Before this pr

OpenJDK 64-Bit Server VM 1.8.0_392-8u392-ga-1~20.04-b08 on Linux 5.15.0-91-generic
13th Gen Intel(R) Core(TM) i9-13900KF
Build Broadcast Hash Table with 1000000 rows:          Best Time(ms)   Avg Time(ms)   Stdev(ms)    Rate(M/s)   Per Row(ns)   Relative
-------------------------------------------------------------------------------------------------------------------------------------
build hash table with 15625 rows with 64 hash tables              74             78           3         13.6          73.8       1.0X
build hash table with 31250 rows with 32 hash tables              73             75           2         13.8          72.5       1.0X
build hash table with 62500 rows with 16 hash tables              77             81           2         13.0          76.8       1.0X
build hash table with 125000 rows with 8 hash tables              73             75           2         13.8          72.6       1.0X
build hash table with 250000 rows with 4 hash tables              88             91           2         11.3          88.3       0.8X
build hash table with 500000 rows with 2 hash tables              82            104          27         12.2          82.0       0.9X
build hash table with 1000000 rows with 1 hash tables             94            107          21         10.6          94.1       0.8X

After this pr

OpenJDK 64-Bit Server VM 1.8.0_392-8u392-ga-1~20.04-b08 on Linux 5.15.0-91-generic
13th Gen Intel(R) Core(TM) i9-13900KF
Build Broadcast Hash Table with 1000000 rows:          Best Time(ms)   Avg Time(ms)   Stdev(ms)    Rate(M/s)   Per Row(ns)   Relative
-------------------------------------------------------------------------------------------------------------------------------------
build hash table with 15625 rows with 64 hash tables              60             62           1         16.6          60.1       1.0X
build hash table with 31250 rows with 32 hash tables              62             63           1         16.3          61.5       1.0X
build hash table with 62500 rows with 16 hash tables              60             63           1         16.6          60.3       1.0X
build hash table with 125000 rows with 8 hash tables              65             69           2         15.4          65.0       0.9X
build hash table with 250000 rows with 4 hash tables              71             74           1         14.1          71.0       0.8X
build hash table with 500000 rows with 2 hash tables              75             78           1         13.3          75.0       0.8X
build hash table with 1000000 rows with 1 hash tables             75             78           2         13.3          75.4       0.8X

(Fixes: #2723)

How was this patch tested?

(Please explain how this patch was tested. E.g. unit tests, integration tests, manual tests)

(If this patch involves UI changes, please attach a screenshot; otherwise, remove this)

@github-actions

Copy link
Copy Markdown

#2723

@github-actions

Copy link
Copy Markdown

Run Gluten Clickhouse CI

@baibaichen
baibaichen force-pushed the feature/broadcast_opt branch from a238d92 to 9a95779 Compare December 30, 2023 02:44
@github-actions

Copy link
Copy Markdown

Run Gluten Clickhouse CI

1 similar comment
@baibaichen

Copy link
Copy Markdown
Contributor Author

Run Gluten Clickhouse CI

@liuneng1994 liuneng1994 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@baibaichen
baibaichen merged commit 8633e53 into apache:main Jan 2, 2024
@baibaichen
baibaichen deleted the feature/broadcast_opt branch January 2, 2024 02:53
baibaichen added a commit to Kyligence/gluten that referenced this pull request Jan 4, 2024
binmahone pushed a commit that referenced this pull request Jan 4, 2024
* [GLUTEN-1632][CH]Daily Update Clickhouse Version (20240104)

* fix build due to ClickHouse/ClickHouse#57053

* fix test due to #4231

* fix ut due to ClickHouse/ClickHouse#58440

don't know the reason, let's relax double equality check

---------

Co-authored-by: kyligence-git <[email protected]>
Co-authored-by: Chang Chen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve CH Backend Broadcast Join performance

2 participants