-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-26155] Optimizing the performance of LongToUnsafeRowMap #23214
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
cc @JkSelf help to check this patch. |
|
cc @cloud-fan , help to review this patch? |
|
ping @viirya |
|
maybe add some detailed test result in description and explain the reason for this in code comment? |
|
@LuciferYang the patch is fine in my test environment. |
|
@JkSelf thx~ |
|
@adrian-wang ok~ I will add some comments to explain the reason |
|
ok to test |
| private var numKeyLookups = 0L | ||
| private var numProbes = 0L | ||
| private var numKeyLookups = new LongAdder | ||
| private var numProbes = new LongAdder |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm surprised. I think LongToUnsafeRowMap is used in a single thread environment and multi-thread contend should not be an issue here. Do you have any insights about how this fixes the perf issue?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Initially, I thought these two variables in class scope will affect SIMD optimization of JIT(after java8), we try to add -XX: -UseSuperWord to executor java opts to vertify this view, but no affect with spark-2.1, although this patch can improve performance....
|
I might know the root cause: For broadcast hash join, we will copy the broadcasted hash relation to avoid multi-thread problem, via The metrics is per-task, so I think a better fix is to track the hash probe metrics per |
|
It's easy to track |
|
Test build #99651 has finished for PR 23214 at commit
|
|
Thanks for doing this. I think we are more close to the root cause. |
Was there no problems of data correctness in the past use unthread-safe Long type? |
|
I think there is a problem, but no one found out because it's only about metrics. |
|
On the other hand, if is only a |
|
As @cloud-fan said |
What changes were proposed in this pull request?
To slove @JkSelf report problem at SPARK-26155, use LongAdder instead of Long of
numKeyLookupsandnumProbesto reduce add operation times. @JkSelf test this patch in Intel performance testing environment and run TPCDS sqls after this patch with Spark-2.3 and master no longer slower than Spark-2.1.How was this patch tested?
N/A