From 82991a5b2128270adbde1f2ed1e335443c596465 Mon Sep 17 00:00:00 2001 From: PJ Fanning Date: Tue, 17 Sep 2024 14:20:43 +0100 Subject: [PATCH 1/2] mark stop() method as noinline --- .../main/scala/org/apache/pekko/actor/dungeon/Dispatch.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/actor/src/main/scala/org/apache/pekko/actor/dungeon/Dispatch.scala b/actor/src/main/scala/org/apache/pekko/actor/dungeon/Dispatch.scala index 99211122951..ac13b4f6a27 100644 --- a/actor/src/main/scala/org/apache/pekko/actor/dungeon/Dispatch.scala +++ b/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 = try dispatcher.systemDispatch(this, Terminate()) catch handleException From 674740a0dfd3b17cbf9a5f8afb0eb2bda4d7150a Mon Sep 17 00:00:00 2001 From: PJ Fanning Date: Wed, 18 Sep 2024 10:49:17 +0100 Subject: [PATCH 2/2] Update Dispatch.scala --- .../main/scala/org/apache/pekko/actor/dungeon/Dispatch.scala | 2 ++ 1 file changed, 2 insertions(+) diff --git a/actor/src/main/scala/org/apache/pekko/actor/dungeon/Dispatch.scala b/actor/src/main/scala/org/apache/pekko/actor/dungeon/Dispatch.scala index ac13b4f6a27..1ce9ee1bc21 100644 --- a/actor/src/main/scala/org/apache/pekko/actor/dungeon/Dispatch.scala +++ b/actor/src/main/scala/org/apache/pekko/actor/dungeon/Dispatch.scala @@ -159,6 +159,8 @@ private[pekko] trait Dispatch { this: ActorCell => catch handleException // ➡➡➡ NEVER SEND THE SAME SYSTEM MESSAGE OBJECT TO TWO ACTORS ⬅⬅⬅ + // this function is marked `noinline` because Kamon and other metrics libraries + // instrument this function @noinline final def stop(): Unit = try dispatcher.systemDispatch(this, Terminate()) catch handleException