Uploaded image for project: 'HttpComponents HttpCore'
  1. HttpComponents HttpCore
  2. HTTPCORE-535

mod workerCount is power of two can be improved as &(workerCount-1)

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.0-beta3
    • Component/s: HttpCore NIO
    • Labels:
      None

      Description

      if workerCount is power of two . improve
      final int i = Math.abs(currentWorker.incrementAndGet() % workerCount);
      to be
      final int i = Math.abs(currentWorker.incrementAndGet() & (workerCount-1) );

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                silver9886 silver9886
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: