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
b28308c9
Commit
b28308c9
authored
Jan 05, 2012
by
neverlord
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
actor creation benchmark
parent
b5bc1675
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
110 additions
and
2 deletions
+110
-2
Makefile.am
Makefile.am
+1
-1
benchmarks/actor_creation.cpp
benchmarks/actor_creation.cpp
+107
-0
configure.ac
configure.ac
+1
-1
cppa.files
cppa.files
+1
-0
No files found.
Makefile.am
View file @
b28308c9
...
@@ -226,4 +226,4 @@ libcppa_la_LDFLAGS = -release $(PACKAGE_VERSION) $(BOOST_CPPFLAGS)
...
@@ -226,4 +226,4 @@ libcppa_la_LDFLAGS = -release $(PACKAGE_VERSION) $(BOOST_CPPFLAGS)
pkgconfigdir
=
$(libdir)
/pkgconfig
pkgconfigdir
=
$(libdir)
/pkgconfig
pkgconfig_DATA
=
libcppa.pc
pkgconfig_DATA
=
libcppa.pc
SUBDIRS
=
.
unit_testing examples
SUBDIRS
=
.
unit_testing examples
benchmarks
benchmarks/actor_creation.cpp
0 → 100644
View file @
b28308c9
/******************************************************************************\
* ___ __ *
* /\_ \ __/\ \ *
* \//\ \ /\_\ \ \____ ___ _____ _____ __ *
* \ \ \ \/\ \ \ '__`\ /'___\/\ '__`\/\ '__`\ /'__`\ *
* \_\ \_\ \ \ \ \L\ \/\ \__/\ \ \L\ \ \ \L\ \/\ \L\.\_ *
* /\____\\ \_\ \_,__/\ \____\\ \ ,__/\ \ ,__/\ \__/.\_\ *
* \/____/ \/_/\/___/ \/____/ \ \ \/ \ \ \/ \/__/\/_/ *
* \ \_\ \ \_\ *
* \/_/ \/_/ *
* *
* Copyright (C) 2011, 2012 *
* Dominik Charousset <dominik.charousset@haw-hamburg.de> *
* *
* This file is part of libcppa. *
* libcppa is free software: you can redistribute it and/or modify it under *
* the terms of the GNU Lesser General Public License as published by the *
* Free Software Foundation, either version 3 of the License *
* or (at your option) any later version. *
* *
* libcppa is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
* See the GNU Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public License *
* along with libcppa. If not, see <http://www.gnu.org/licenses/>. *
\******************************************************************************/
#include <cstdlib>
#include <cstring>
#include <iostream>
#include "cppa/cppa.hpp"
#include "cppa/fsm_actor.hpp"
using
std
::
cout
;
using
std
::
cerr
;
using
std
::
endl
;
using
namespace
cppa
;
struct
testee
:
event_based_actor
{
int
m_x
;
testee
(
int
x
)
:
m_x
(
x
)
{
}
void
init
()
{
if
(
m_x
>
0
)
{
spawn
(
new
testee
(
m_x
-
1
));
spawn
(
new
testee
(
m_x
-
1
));
}
}
};
void
cr_stacked_actor
(
int
x
)
{
if
(
x
>
0
)
{
spawn
(
cr_stacked_actor
,
x
-
1
);
spawn
(
cr_stacked_actor
,
x
-
1
);
}
}
void
usage
()
{
cout
<<
"usage: actor_creation (stacked|event-based) POW"
<<
endl
<<
" creates 2^POW actors"
<<
endl
<<
endl
;
}
int
main
(
int
argc
,
char
**
argv
)
{
if
(
argc
==
3
)
{
char
*
endptr
=
nullptr
;
int
num
=
static_cast
<
int
>
(
strtol
(
argv
[
2
],
&
endptr
,
10
));
if
(
endptr
==
nullptr
||
*
endptr
!=
'\0'
)
{
cerr
<<
"
\"
"
<<
argv
[
2
]
<<
"
\"
is not an integer"
<<
endl
;
return
1
;
}
if
(
strcmp
(
argv
[
1
],
"stacked"
)
==
0
)
{
spawn
(
cr_stacked_actor
,
num
);
}
else
if
(
strcmp
(
argv
[
1
],
"event-based"
)
==
0
)
{
spawn
(
new
testee
(
num
));
}
else
{
usage
();
return
1
;
}
await_all_others_done
();
}
else
{
usage
();
return
1
;
}
return
0
;
}
configure.ac
View file @
b28308c9
...
@@ -43,5 +43,5 @@ CPPFLAGS="$ORIGINAL_CPPFLAGS"
...
@@ -43,5 +43,5 @@ CPPFLAGS="$ORIGINAL_CPPFLAGS"
AC_ARG_VAR([NO_VERSIONED_INCLUDE_DIR], [set this to 1 in order to install headers into <prefix>/cppa/ rather than into <prefix>/cppa/<version>/cppa/])
AC_ARG_VAR([NO_VERSIONED_INCLUDE_DIR], [set this to 1 in order to install headers into <prefix>/cppa/ rather than into <prefix>/cppa/<version>/cppa/])
AM_CONDITIONAL([VERSIONED_INCLUDE_DIR], [test "x$NO_VERSIONED_INCLUDE_DIR" != "x1"])
AM_CONDITIONAL([VERSIONED_INCLUDE_DIR], [test "x$NO_VERSIONED_INCLUDE_DIR" != "x1"])
AC_CONFIG_FILES([Makefile unit_testing/Makefile examples/Makefile libcppa.pc])
AC_CONFIG_FILES([Makefile unit_testing/Makefile examples/Makefile
benchmarks/Makefile
libcppa.pc])
AC_OUTPUT
AC_OUTPUT
cppa.files
View file @
b28308c9
...
@@ -244,3 +244,4 @@ cppa/self.hpp
...
@@ -244,3 +244,4 @@ cppa/self.hpp
src/self.cpp
src/self.cpp
cppa/behavior.hpp
cppa/behavior.hpp
src/receive.cpp
src/receive.cpp
benchmarks/actor_creation.cpp
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