Skip to content

4.x: parallel performs poorly with 10+ parallelism #6931

Description

@akarnokd

For some reason, the parallel Scrabble benchmark performs poorly when the parallelism level is 10+, for example, on my i7 8700 CPU (6 cores/12 threads):

image

However, my older i7 4770K processor (4 cores/8 threads) shows no such performance degradation. Neither does the reactive-streams-commons implementation (the parent of RxJava's parallel implementation) with parallelism=12.
Correction: The Rsc benchmark was pinned to 8 threads and actually shows a similar inefficiency with 10+.

Activity

  1. added this to the 3.1 milestone on Mar 11, 2020
  2. self-assigned this
    on Mar 11, 2020
  3. akarnokd commented on Mar 11, 2020

    @akarnokd
    MemberAuthor

    I did a different implementation but the degradation isn't gone, just reduced:

    image

    With the new code organization, the performance is slightly worse at P=1 and P=6 and somewhat better at higher Ps. The others are likely within the noise limit.

    image

    I'm starting to think the underlying issue is that one thread simply can't drive that many rails that fast, thus the round-robin dispatching will result in a high volume of scheduling activity (also hinted by Java Flight Recorder).

  4. akarnokd commented on Mar 11, 2020

    @akarnokd
    MemberAuthor

    If I implement batch-dispatching, the the scheduling overhead appears to be mostly eliminated:

    image

  5. changed the title [-]3.x: parallel and/or p-reduce performs poorly with 10+ parallelism[/-] [+]3.x: parallel performs poorly with 10+ parallelism[/+] on Mar 11, 2020
  6. muralik09 commented on Oct 31, 2020

    @muralik09

    you have consider lot of aspects while making parallel calls.

    one request want to make 10 parallel calls means and your server supports only 12 threads, what about the second request, it will wait releasing of threads from first request.

    you have check back all the 12 threads are allocated to your program.

    etc...

  7. modified the milestones: 3.1, 3.1-support on Aug 10, 2021
  8. added and removed on Mar 19, 2026
  9. modified the milestones: 3.1-support, 4.0 on Mar 25, 2026
  10. added theissue type on Mar 25, 2026
  11. changed the title [-]3.x: parallel performs poorly with 10+ parallelism[/-] [+]4.x: parallel performs poorly with 10+ parallelism[/+] on Jul 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions