robert3005 opened a new pull request, #60426: URL: https://github.com/apache/spark/pull/60426
### What changes were proposed in this pull request? safeLookup is the lookup that many threads share. Broadcast hash joins call it from every task on the same read-only UnsafeHashedRelation map. It incremented the shared fields numKeyLookups and numProbes on each lookup, so all threads wrote to the same cache line. On a 32-core machine, a broadcast hash join on three long keys spent about 2 us per probe row on this contention. Now only lookup() updates the probe statistics. lookup() is not thread-safe, and the aggregation maps that read getAvgHashProbesPerKey use it. safeLookup and lookup share private probe methods that return the number of probes. ### Why are the changes needed? Running many tasks on the same ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested? Added unit tests, profiled in tpc-ds benchmarks ### Was this patch authored or co-authored using generative AI tooling? Generated-By: Claude Opus 5.5 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
