Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
Actor Framework
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cpp-libs
Actor Framework
Commits
72454443
Commit
72454443
authored
Jul 10, 2012
by
neverlord
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ported benchmark to akka >= 2.0
parent
64ac26a1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
12 deletions
+14
-12
benchmarks/ActorCreation.scala
benchmarks/ActorCreation.scala
+14
-12
No files found.
benchmarks/ActorCreation.scala
View file @
72454443
import
scala.actors.Actor
import
scala.actors.Actor._
import
akka.actor.
Actor.actorOf
import
akka.actor.
{
Props
,
Actor
=>
AkkaActor
,
ActorRef
=>
AkkaActorRef
,
ActorSystem
}
case
object
GoAhead
...
...
@@ -57,37 +57,37 @@ class ThreadlessTestee(parent: Actor) extends Actor {
}
}
class
AkkaTestee
(
parent
:
akka.actor.ActorRef
)
extends
akka
.
actor
.
Actor
{
class
AkkaTestee
(
parent
:
AkkaActorRef
)
extends
Akka
Actor
{
def
receive
=
{
case
Spread
(
0
)
=>
parent
!
Result
(
1
)
self
.
stop
context
.
stop
(
self
)
case
Spread
(
s
)
=>
val
msg
=
Spread
(
s
-
1
)
actorOf
(
new
AkkaTestee
(
self
)).
start
!
msg
actorOf
(
new
AkkaTestee
(
self
)).
start
!
msg
become
{
context
.
actorOf
(
Props
(
new
AkkaTestee
(
self
)))
!
msg
context
.
actorOf
(
Props
(
new
AkkaTestee
(
self
)))
!
msg
context
.
become
{
case
Result
(
r1
)
=>
become
{
context
.
become
{
case
Result
(
r2
)
=>
parent
!
Result
(
r1
+
r2
)
self
.
exit
context
.
stop
(
self
)
}
}
}
}
class
AkkaRootTestee
(
n
:
Int
)
extends
akka
.
actor
.
Actor
{
class
AkkaRootTestee
(
n
:
Int
)
extends
Akka
Actor
{
def
receive
=
{
case
GoAhead
=>
actorOf
(
new
AkkaTestee
(
self
)).
start
!
Spread
(
n
)
context
.
actorOf
(
Props
(
new
AkkaTestee
(
self
)))
!
Spread
(
n
)
case
Result
(
v
)
=>
if
(
v
!=
(
1
<<
n
))
{
Console
.
println
(
"Expected "
+
(
1
<<
n
)
+
", received "
+
v
)
System
.
exit
(
42
)
}
global
.
latch
.
countDown
self
.
exit
context
.
stop
(
self
)
}
}
...
...
@@ -122,9 +122,11 @@ object ActorCreation {
}
}
else
if
(
args
(
0
)
==
"akka"
)
{
actorOf
(
new
AkkaRootTestee
(
n
)).
start
!
GoAhead
val
system
=
ActorSystem
()
system
.
actorOf
(
Props
(
new
AkkaRootTestee
(
n
)))
!
GoAhead
global
.
latch
.
await
}
else
usage
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment