Skip to content
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

[GR-63337] Remove pointless parallel stream processing for classpath entries. #10920

Merged
merged 1 commit into from
Apr 7, 2025

Conversation

graalvmbot
Copy link
Collaborator

Since we already execute all calls to
NativeImageClassLoaderSupport.LoadClassHandler#handleClassFileName
via the ForkJoinPool.commonPool(), the use of parallelStream() here
does not further increase parallel execution and can be replaced
with a simple forEach without increasing class initialization time.

Additionally, avoiding parallelStream() fixes a deadlock that was
observable when only one CPU core is available (parallel streams
also use the commonPool() and this can lead to a deadlock with our
own use on single core systems).

Since we already execute all calls to
NativeImageClassLoaderSupport.LoadClassHandler#handleClassFileName
via the ForkJoinPool.commonPool(), the use of parallelStream() here
does not further increase parallel execution and can be replaced
with a simple forEach without increasing class initialization time.

Additionally, avoiding parallelStream() fixes a deadlock that was
observable when only one CPU core is available (parallel streams
also use the commonPool() and this can lead to a deadlock with our
own use on single core systems).
@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Mar 25, 2025
@graalvmbot graalvmbot closed this Apr 7, 2025
@graalvmbot graalvmbot deleted the paw/GR-63337 branch April 7, 2025 13:15
@graalvmbot graalvmbot merged commit 22ab614 into master Apr 7, 2025
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OCA Verified All contributors have signed the Oracle Contributor Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants