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
5ccd3a08
Commit
5ccd3a08
authored
Jan 21, 2012
by
neverlord
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
benchmark update
parent
ad3754fa
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
15 deletions
+29
-15
benchmarks/mk_theron.sh
benchmarks/mk_theron.sh
+13
-6
benchmarks/theron_mailbox_performance.cpp
benchmarks/theron_mailbox_performance.cpp
+1
-1
benchmarks/theron_mixed_case.cpp
benchmarks/theron_mixed_case.cpp
+15
-8
No files found.
benchmarks/mk_theron.sh
View file @
5ccd3a08
#!/bin/bash
IFLAGS
=
"-I../../Theron/Include/"
LFLAGS
=
"-L../../Theron/Lib -ltheron -lboost_thread"
FLAGS
=
"-O2 -fno-strict-aliasing -DNDEBUG -DTHERON_MAX_ACTORS=530000"
for
i
in
theron_
*
.cpp
;
do
out_file
=
$(
echo
$i
|
sed
's/\(.*\)\..*/\1/'
)
echo
"g++ -std=c++0x
$i
-o
$out_file
$FLAGS
$LFLAGS
$IFLAGS
"
g++
-std
=
c++0x
$i
-o
$out_file
$FLAGS
$LFLAGS
$IFLAGS
done
FLAGS
=
"-O3 -fno-strict-aliasing -DNDEBUG -DTHERON_MAX_ACTORS=530000"
if
[[
$#
-eq
0
]]
;
then
for
i
in
theron_
*
.cpp
;
do
out_file
=
$(
echo
$i
|
sed
's/\(.*\)\..*/\1/'
)
echo
"g++ -std=c++0x
$i
-o
$out_file
$FLAGS
$LFLAGS
$IFLAGS
"
g++
-std
=
c++0x
$i
-o
$out_file
$FLAGS
$LFLAGS
$IFLAGS
done
elif
[[
$#
-eq
1
]]
;
then
echo
"g++ -std=c++0x theron_
$1
.cpp -o theron_
$1
$FLAGS
$LFLAGS
$IFLAGS
"
g++
-std
=
c++0x theron_
$1
.cpp
-o
theron_
$1
$FLAGS
$LFLAGS
$IFLAGS
fi
benchmarks/theron_mailbox_performance.cpp
View file @
5ccd3a08
...
...
@@ -59,7 +59,7 @@ int main(int argc, char** argv)
{
if
(
argc
!=
4
)
{
return
1
;
usage
()
;
}
enum
{
invalid_impl
,
push_impl
,
send_impl
}
impl
=
invalid_impl
;
if
(
strcmp
(
argv
[
1
],
"push"
)
==
0
)
impl
=
push_impl
;
...
...
benchmarks/theron_mixed_case.cpp
View file @
5ccd3a08
...
...
@@ -55,7 +55,7 @@ struct chain_link : Actor
{
Send
(
msg
,
next
);
}
typedef
struct
{
Address
next
}
Parameters
;
typedef
struct
{
Address
next
;
}
Parameters
;
chain_link
(
Parameters
const
&
p
)
:
next
(
p
.
next
)
{
RegisterHandler
(
this
,
&
chain_link
::
handle_token
);
...
...
@@ -68,25 +68,25 @@ struct master : Actor
int
iteration
;
int
max_iterations
;
Address
next
;
ActorRef
w
orker
;
ActorRef
w
;
int
ring_size
;
int
initial_token_value
;
std
::
vector
<
ActorRef
>
m_children
;
void
new_ring
()
{
m_children
.
clear
();
w
orker
.
Push
(
calc_msg
{
s_task_n
},
GetAddress
());
w
.
Push
(
calc_msg
{
s_task_n
},
GetAddress
());
next
=
GetAddress
();
for
(
int
i
=
1
;
i
<
ring_size
;
++
i
)
{
m_children
.
push_back
(
GetFramework
().
CreateActor
<
chain_link
>
(
chain_link
::
Parameters
(
next
)
));
m_children
.
push_back
(
GetFramework
().
CreateActor
<
chain_link
>
(
chain_link
::
Parameters
{
next
}
));
next
=
m_children
.
back
().
GetAddress
();
}
Send
(
token_msg
{
initial_token_value
},
next
);
}
void
handle_init
(
init_msg
const
&
msg
,
Address
)
{
w
orker
=
GetFramework
().
CreateActor
<
worker
>
();
w
=
GetFramework
().
CreateActor
<
worker
>
();
iteration
=
0
;
ring_size
=
msg
.
ring_size
;
initial_token_value
=
msg
.
token_value
;
...
...
@@ -103,7 +103,7 @@ struct master : Actor
}
else
{
w
orker
.
Push
(
master_done
(),
GetAddress
());
w
.
Push
(
master_done
(),
GetAddress
());
}
}
else
...
...
@@ -114,15 +114,21 @@ struct master : Actor
void
handle_worker_done
(
worker_done
const
&
,
Address
)
{
Send
(
master_done
(),
mc
);
w
=
ActorRef
::
Null
();
}
typedef
struct
{
Address
mc
;
}
Parameters
;
master
(
Parameters
const
&
p
)
mc
(
p
.
mc
),
iteration
(
0
)
{
}
master
(
Parameters
const
&
p
)
:
mc
(
p
.
mc
),
iteration
(
0
)
{
RegisterHandler
(
this
,
&
master
::
handle_init
);
RegisterHandler
(
this
,
&
master
::
handle_token
);
RegisterHandler
(
this
,
&
master
::
handle_worker_done
);
}
}
;
void
usage
()
{
cout
<<
"usage: mailbox_performance "
"
_
(num rings) (ring size) "
"
'send'
(num rings) (ring size) "
"(initial token value) (repetitions)"
<<
endl
<<
endl
;
...
...
@@ -132,6 +138,7 @@ void usage()
int
main
(
int
argc
,
char
**
argv
)
{
if
(
argc
!=
6
)
usage
();
if
(
strcmp
(
"send"
,
argv
[
1
])
!=
0
)
usage
();
int
num_rings
=
rd
<
int
>
(
argv
[
2
]);
int
ring_size
=
rd
<
int
>
(
argv
[
3
]);
int
inital_token_value
=
rd
<
int
>
(
argv
[
4
]);
...
...
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