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
d4fdf6a7
Commit
d4fdf6a7
authored
Jan 08, 2012
by
neverlord
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
benchmark update
parent
7a415741
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
12 deletions
+26
-12
benchmarks/exec.sh
benchmarks/exec.sh
+1
-1
benchmarks/mailbox_performance.cpp
benchmarks/mailbox_performance.cpp
+1
-1
benchmarks/mixed_case.cpp
benchmarks/mixed_case.cpp
+24
-10
No files found.
benchmarks/exec.sh
View file @
d4fdf6a7
#!/bin/bash
#!/bin/bash
read
-r
cmd
read
-r
cmd
export
JAVA_OPTS
=
"-Xmx4096M"
export
JAVA_OPTS
=
"-Xmx4096M"
/usr/bin/time
-p
$cmd
2>&1
#| grep "^real" | grep -o -P "[0-9]*(\.[0-9]*)?"
/usr/bin/time
-p
-f
"%e"
$cmd
2>&1
#| grep "^real" | grep -o -P "[0-9]*(\.[0-9]*)?"
benchmarks/mailbox_performance.cpp
View file @
d4fdf6a7
...
@@ -57,7 +57,7 @@ struct fsm_receiver : fsm_actor<fsm_receiver>
...
@@ -57,7 +57,7 @@ struct fsm_receiver : fsm_actor<fsm_receiver>
++
m_value
;
++
m_value
;
if
(
m_value
==
max
)
if
(
m_value
==
max
)
{
{
quit
(
exit_reason
::
normal
);
become_void
(
);
}
}
}
}
);
);
...
...
benchmarks/mixed_case.cpp
View file @
d4fdf6a7
...
@@ -114,8 +114,12 @@ struct fsm_chain_link : fsm_actor<fsm_chain_link>
...
@@ -114,8 +114,12 @@ struct fsm_chain_link : fsm_actor<fsm_chain_link>
send
(
next
,
atom
(
"token"
),
v
);
send
(
next
,
atom
(
"token"
),
v
);
if
(
v
==
0
)
if
(
v
==
0
)
{
{
quit
(
exit_reason
::
normal
);
become_void
(
);
}
}
},
on
(
atom
(
"done"
))
>>
[
=
]()
{
become_void
();
}
}
);
);
}
}
...
@@ -165,7 +169,8 @@ struct fsm_chain_master : fsm_actor<fsm_chain_master>
...
@@ -165,7 +169,8 @@ struct fsm_chain_master : fsm_actor<fsm_chain_master>
exit_reason
::
user_defined
);
exit_reason
::
user_defined
);
if
(
remainig_results
==
0
)
if
(
remainig_results
==
0
)
{
{
quit
(
exit_reason
::
normal
);
send
(
worker
,
atom
(
"done"
));
become_void
();
}
}
else
else
{
{
...
@@ -177,7 +182,8 @@ struct fsm_chain_master : fsm_actor<fsm_chain_master>
...
@@ -177,7 +182,8 @@ struct fsm_chain_master : fsm_actor<fsm_chain_master>
--
remainig_results
;
--
remainig_results
;
if
(
remainig_results
==
0
)
if
(
remainig_results
==
0
)
{
{
quit
(
exit_reason
::
normal
);
send
(
worker
,
atom
(
"done"
));
become_void
();
}
}
}
}
);
);
...
@@ -203,30 +209,38 @@ void tst();
...
@@ -203,30 +209,38 @@ void tst();
void
chain_link
(
actor_ptr
next
)
void
chain_link
(
actor_ptr
next
)
{
{
receive_loop
bool
done
=
false
;
do_receive
(
(
on
<
atom
(
"token"
),
int
>
()
>>
[
&
](
int
v
)
on
<
atom
(
"token"
),
int
>
()
>>
[
&
](
int
v
)
{
{
send
(
next
,
atom
(
"token"
),
v
);
send
(
next
,
atom
(
"token"
),
v
);
if
(
v
==
0
)
if
(
v
==
0
)
{
{
quit
(
exit_reason
::
normal
)
;
done
=
true
;
}
}
}
}
);
)
.
until
([
&
]()
{
return
done
==
true
;
});
}
}
void
chain_master
()
void
chain_master
()
{
{
auto
worker
=
spawn
([]()
auto
worker
=
spawn
([]()
{
{
receive_loop
bool
done
=
false
;
do_receive
(
(
on
<
atom
(
"calc"
),
uint64_t
>
()
>>
[
=
](
uint64_t
what
)
on
<
atom
(
"calc"
),
uint64_t
>
()
>>
[](
uint64_t
what
)
{
{
reply
(
atom
(
"result"
),
factorize
(
what
));
reply
(
atom
(
"result"
),
factorize
(
what
));
},
on
(
atom
(
"done"
))
>>
[
&
]()
{
done
=
true
;
}
}
);
)
.
until
([
&
]()
{
return
done
==
true
;
});
});
});
actor_ptr
next
;
actor_ptr
next
;
int
remaining_results
=
0
;
int
remaining_results
=
0
;
...
@@ -273,7 +287,7 @@ void chain_master()
...
@@ -273,7 +287,7 @@ void chain_master()
&&
remaining_results
==
0
;
});
&&
remaining_results
==
0
;
});
}
}
);
);
send
(
worker
,
atom
(
"
:Exit"
),
exit_reason
::
user_defined
);
send
(
worker
,
atom
(
"
done"
)
);
}
}
template
<
typename
F
>
template
<
typename
F
>
...
...
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