jrudolph commented on code in PR #1485:
URL: https://github.com/apache/pekko/pull/1485#discussion_r1764532944


##########
actor/src/main/scala/org/apache/pekko/actor/dungeon/Dispatch.scala:
##########
@@ -159,7 +159,7 @@ private[pekko] trait Dispatch { this: ActorCell =>
     catch handleException
 
   // ➡➡➡ NEVER SEND THE SAME SYSTEM MESSAGE OBJECT TO TWO ACTORS ⬅⬅⬅
-  final def stop(): Unit =
+  @noinline final def stop(): Unit =

Review Comment:
   The Scala compiler is free to inline method when it is sound. This is the 
case, when the final receiver of a call can be determined. Whether or not that 
has any performance impact is always hard to say. In general, the JVM JIT 
compilation will also do heavy inlining and may in many cases do the same kind 
of optimizations at runtime. In other cases, like e.g. for higher-order 
methods, the Scala compiler might be able to generate significantly less code 
by earlier inlining, which also helps JIT compilations.
   
   That said, the point of adding `@noinline` here is that some telemetry tools 
like Kamon instrument internal APIs to do their work. This has mainly historic 
reasons. In the future, it could be better to introduce official hooks for 
these kinds of use cases, so that it is easier to track what the public 
telemetry API is instead of relying on keeping some internal APIs stable.



-- 
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