The GitHub Actions job "Pull Requests" on pekko.git/perf/onSpinWait-cas-loops 
has succeeded.
Run started by GitHub user He-Pin (triggered by He-Pin).

Head commit for run:
cae9d23d770406329f3baabc4c0e0b886e044b3e / 虎鸣 <[email protected]>
perf: add Thread.onSpinWait() to CAS spin loops

Motivation:
CAS retry loops in AbstractDispatcher and Mailbox spin without any
CPU hint when contention causes compareAndSet to fail. JDK 9's
Thread.onSpinWait() hints to the CPU that we're in a spin-wait
loop, improving power efficiency and reducing context-switch
latency.

Modification:
- AbstractDispatcher.scala: add onSpinWait() in shutdown schedule
  CAS retry loop body
- Mailbox.scala: convert setAsScheduled() and setAsIdle() from
  @tailrec recursive CAS loops to while loops with onSpinWait(),
  re-reading currentStatus on each retry

Result:
Better CPU behavior under contention on the message dispatch hot
path (setAsScheduled is called on every registerForExecution).
The onSpinWait pattern is already established in the codebase
(AbstractNodeQueue, AbstractBoundedNodeQueue, AffinityPool).

Tests:
sbt "actor/compile" — passed

References:
Refs #3136

Report URL: https://github.com/apache/pekko/actions/runs/28003082873

With regards,
GitHub Actions via GitBox


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to