He-Pin opened a new pull request, #3035:
URL: https://github.com/apache/pekko/pull/3035

   ### Motivation
   The public issue https://github.com/akka/akka-core/issues/26857 describes an 
opportunity to avoid an extra actor hop for non-eager stage actor refs, which 
is now Apache licensed.
   
   ### Modification
   Add separate eager and lazy `StageActorRef` handlers:
   
   - non-eager `getStageActor` refs are attached to the graph interpreter actor 
and still dispatch through `GraphInterpreter.onAsyncInput`
   - eager stage actor refs keep the existing materializer supervisor + async 
callback path so they remain usable before stream demand
   - directional tests cover lazy parent placement, lazy message delivery, 
eager pre-demand usability, and eager supervisor placement
   - add a JMH benchmark for lazy `StageActorRef.tell` throughput
   
   ### Result
   Non-eager stage actor messages target the graph interpreter actor while 
preserving async-input semantics and eager compatibility.
   
   ### Benchmark
   JMH smoke result:
   
   ```text
   StageActorRefBenchmark.lazy_stage_actor_ref_tell_10k  thrpt  5611073.982 
ops/s
   ```
   
   Command:
   
   ```shell
   sbt "bench-jmh / clean" "bench-jmh/Jmh/run -i 1 -wi 0 -f 1 -r 1s -w 1s 
.*StageActorRefBenchmark.*"
   ```
   
   ### Tests
   - `scalafmt 
stream/src/main/scala/org/apache/pekko/stream/stage/GraphStage.scala 
stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/StageActorRefSpec.scala
 bench-jmh/src/main/scala/org/apache/pekko/stream/StageActorRefBenchmark.scala`
   - `sbt "stream-tests / Test / testOnly 
org.apache.pekko.stream.scaladsl.StageActorRefSpec"`
   - `sbt "bench-jmh / Compile / compile" "stream / mimaReportBinaryIssues" 
"bench-jmh / headerCheck"`
   - `sbt "bench-jmh / clean" "bench-jmh/Jmh/run -i 1 -wi 0 -f 1 -r 1s -w 1s 
.*StageActorRefBenchmark.*"`
   - `git diff --check`
   
   ### Clean-room note
   This implementation was developed against the Pekko codebase and the public 
issue statement only. No upstream code, tests, comments, or diff content were 
copied.
   
   ### References
   Refs https://github.com/akka/akka-core/issues/26857
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to