dongjoon-hyun opened a new pull request, #57885:
URL: https://github.com/apache/spark/pull/57885

   ### What changes were proposed in this pull request?
   
   This PR aims to update the outdated performance claims in the class 
documentation of
   `OpenHashMap` and `OpenHashSet`, based on the results of 
`OpenHashMapBenchmark` added
   by SPARK-58678.
   
   - `OpenHashMap`: replaced the claim "about 5X faster than java.util.HashMap" 
with an
     accurate description: it uses much less space and is competitive for 
aggregation
     workloads (`changeValue`), while `java.util.HashMap` is faster for pure 
insertions
     and lookups on modern JDKs.
   - `OpenHashSet`: replaced the unqualified claim "much faster than Java's 
standard
     HashSet" with the verifiable facts: much less memory overhead, and the 
specialized
     versions avoid boxing of primitive keys.
   
   ### Why are the changes needed?
   
   The "about 5X faster" claim dates from 2013 (pre-JDK 8). 
`OpenHashMapBenchmark`
   (SPARK-58678) shows that on modern JDKs the claim no longer holds:
   
   - **Insert**: `java.util.HashMap` is 4.6X, 5.5X, 6.5X faster on Java 17, 21, 
and 25,
     respectively.
   - **Lookup**: `java.util.HashMap` is about 2X faster.
   - **Aggregate** (`changeValue`/`merge`): `OpenHashMap` is slightly faster.
   
   Since the benchmark's insert/lookup paths with object keys effectively 
measure
   `OpenHashSet` as well, its unqualified "much faster" claim is also updated. 
The
   memory advantage (about 2.2x less for `String -> Long` entries) remains true 
and is
   kept.
   
   ### Does this PR introduce _any_ user-facing change?
   
   No. This is a comment-only change.
   
   ### How was this patch tested?
   
   Pass the CIs. This is a comment-only change with no behavior change.
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   Generated-by: Claude Fable 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]

Reply via email to