Skip to content

[SPARK-58682][DOCS] Update outdated OpenHashMap/OpenHashSet performance claims - #57885

Closed
dongjoon-hyun wants to merge 1 commit into
apache:masterfrom
dongjoon-hyun:SPARK-58682
Closed

[SPARK-58682][DOCS] Update outdated OpenHashMap/OpenHashSet performance claims#57885
dongjoon-hyun wants to merge 1 commit into
apache:masterfrom
dongjoon-hyun:SPARK-58682

Conversation

@dongjoon-hyun

Copy link
Copy Markdown
Member

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

@dongjoon-hyun

Copy link
Copy Markdown
Member Author

Could you review this doc-only PR, @LuciferYang ?

@LuciferYang LuciferYang 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

@dongjoon-hyun

Copy link
Copy Markdown
Member Author

Thank you, @LuciferYang !

@dongjoon-hyun

Copy link
Copy Markdown
Member Author

Thank you, @HyukjinKwon .

dongjoon-hyun added a commit that referenced this pull request Aug 10, 2026
…mance claims

### 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

Closes #57885 from dongjoon-hyun/SPARK-58682.

Authored-by: Dongjoon Hyun <dongjoon@apache.org>
Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
(cherry picked from commit 5adcd21)
Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
dongjoon-hyun added a commit that referenced this pull request Aug 10, 2026
…mance claims

### 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

Closes #57885 from dongjoon-hyun/SPARK-58682.

Authored-by: Dongjoon Hyun <dongjoon@apache.org>
Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
(cherry picked from commit 5adcd21)
Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
dongjoon-hyun added a commit that referenced this pull request Aug 10, 2026
…mance claims

### 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

Closes #57885 from dongjoon-hyun/SPARK-58682.

Authored-by: Dongjoon Hyun <dongjoon@apache.org>
Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
(cherry picked from commit 5adcd21)
Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
@dongjoon-hyun

Copy link
Copy Markdown
Member Author

Merge Summary:

Posted by merge_spark_pr.py

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.

3 participants