Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Performance regression for ByteArrayMemory on Java 25

Open
#224 2 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
55/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
java
Domain
performance

Research direction

Read ByteArrayMemory and compare its atomic access handling with ByteBufferMemory's lock fallback. Run the multithreaded BenchmarkSievePrimes benchmark on JDK 25 to observe the reported regression; done for the immediate bug means ByteArrayMemory uses the slow lock path when atomic access is unsupported. The NativeMemory promotion is a separate, broader proposal.

Written by the indexing model from the issue text.

Description

If running the multithreaded BenchmarkSievePrimes bench on JDK 25, one can witness a radical performance breakdown. On my local machine it runs 220 times slower than on JDK 21. The reason is primarily that it calls isAccessModeSupported on every atomic read/write. On JDK 25 this throws a NoSuchMethodError internally before returning false. AFAIK there is no supported way of doing atomics on byte[] in JDK 25 and in this scenario ByteArrayMemory should fallback to the slow lock path just like ByteBufferMemory.

After fixing this, there still won't be a performant memory on JDK 25. I propose the Redline NativeMemory (or a hardened version thereof) is promoted to a neutral supported module. It still needs its own module if runtime is to remain on JDK 11. My own experimentation has shown that the native mapped memory can also give a good performance boost when using the bytecode compilers.

Dominant language
Java
Stars
310
Forks
23
Avg merge
2d 8h
Merged PRs (30d)
33

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from bytecodealliance/endive

All issues in bytecodealliance/endive

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.