-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18 from abeimler/develop
6.1.0
- Loading branch information
Showing
85 changed files
with
2,198 additions
and
281 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,7 +18,7 @@ cpmaddpackage( | |
GITHUB_REPOSITORY | ||
aminya/project_options | ||
VERSION | ||
0.33.0 | ||
0.34.0 | ||
# GIT_TAG main | ||
DOWNLOAD_ONLY) | ||
if(project_options_ADDED) | ||
|
@@ -34,7 +34,7 @@ run_vcpkg() | |
# Set the project name and language | ||
project( | ||
ecs-benchmark | ||
VERSION 6.0.0 | ||
VERSION 6.1.0 | ||
DESCRIPTION "Benchmarks of common ECS (Entity-Component-System)-Frameworks in C++ (or C)" | ||
HOMEPAGE_URL "https://github.com/abeimler/ecs_benchmark" | ||
LANGUAGES CXX C) | ||
|
@@ -65,13 +65,14 @@ include(cmake/ProjectOptions.cmake) | |
# ---- Add dependencies via CPM ---- | ||
# see https://github.com/TheLartians/CPM.cmake for more info | ||
include(cmake/CPM.cmake) | ||
# PackageProject.cmake will be used to make our target installable | ||
cpmaddpackage("gh:TheLartians/[email protected]") | ||
# PackageProject.cmake will be used to make our target installable https://github.com/TheLartians/PackageProject.cmake | ||
cpmaddpackage("gh:TheLartians/[email protected]") | ||
# https://github.com/TheLartians/Format.cmake | ||
cpmaddpackage( | ||
NAME | ||
Format.cmake | ||
VERSION | ||
1.7.3 | ||
1.8.1 | ||
GITHUB_REPOSITORY | ||
TheLartians/Format.cmake | ||
OPTIONS | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
6.0.0 | ||
6.1.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
set(INCLUDE_DIR "include") # must be relative paths | ||
# NOTE: rename project in "ecs-benchmark-myecs" | ||
add_executable( | ||
ecs-benchmark-gaia-ecs-entities | ||
# NOTE: add new benchmarks here | ||
GaiaEcsEntityBenchmarkSuite.cpp GaiaEcsEntityBenchmarkSuite.h) | ||
target_include_directories( | ||
ecs-benchmark-gaia-ecs-entities | ||
PRIVATE "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>" "$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/${INCLUDE_DIR}>" | ||
"$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/${INCLUDE_DIR}>" "$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/${INCLUDE_DIR}>") | ||
target_link_libraries(ecs-benchmark-gaia-ecs-entities PRIVATE project_warnings project_options) | ||
target_link_libraries(ecs-benchmark-gaia-ecs-entities PRIVATE ecs-benchmark) | ||
|
||
# @NOTE: add libs for example here | ||
target_link_libraries(ecs-benchmark-gaia-ecs-entities PRIVATE ecs-benchmark-example-gaia-ecs) |
17 changes: 17 additions & 0 deletions
17
benchmark/benchmarks/gaia-ecs-entities/GaiaEcsEntityBenchmarkSuite.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#include "GaiaEcsEntityBenchmarkSuite.h" | ||
|
||
static ecs::benchmarks::gaia_ecs::GaiaEcsEntityBenchmarkSuite benchmark_suite; | ||
|
||
ECS_ENTITY_BENCHMARKS(benchmark_suite) | ||
|
||
/* | ||
static void BM_CreateEntitiesInBulk(benchmark::State& state) { | ||
benchmark_suite.BM_CreateEntitiesInBulk(state); | ||
} | ||
BENCHMARK(BM_CreateEntitiesInBulk)->Apply(ecs::benchmarks::base::BEDefaultArguments); | ||
static void BM_CreateEmptyEntitiesInBulk(benchmark::State& state) { | ||
benchmark_suite.BM_CreateEmptyEntitiesInBulk(state); | ||
} | ||
BENCHMARK(BM_CreateEmptyEntitiesInBulk)->Apply(ecs::benchmarks::base::BEDefaultArguments); | ||
*/ |
22 changes: 22 additions & 0 deletions
22
benchmark/benchmarks/gaia-ecs-entities/GaiaEcsEntityBenchmarkSuite.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#ifndef ECS_BENCHMARKS_GAIA_ECS_ENTITYBENCHMARK_H_ | ||
#define ECS_BENCHMARKS_GAIA_ECS_ENTITYBENCHMARK_H_ | ||
|
||
#include "EntityBenchmark.h" | ||
#include "gaia-ecs/entities/EntityFactory.h" | ||
#include <utility> | ||
|
||
|
||
namespace ecs::benchmarks::gaia_ecs { | ||
|
||
class GaiaEcsEntityBenchmarkSuite final | ||
: public ecs::benchmarks::base::EntityBenchmark<"gaia-ecs", entities::EntityFactory> { | ||
public: | ||
GaiaEcsEntityBenchmarkSuite() = default; | ||
|
||
explicit GaiaEcsEntityBenchmarkSuite(ecs::benchmarks::base::ESCBenchmarkOptions options) | ||
: EntityBenchmark(std::move(options)) {} | ||
}; | ||
|
||
} // namespace ecs::benchmarks::gaia_ecs | ||
|
||
#endif // ECS_BENCHMARKS_GAIA_ECS_ENTITYBENCHMARK_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
set(INCLUDE_DIR "include") # must be relative paths | ||
|
||
# NOTE: rename project in "ecs-benchmark-myecs" | ||
add_executable( | ||
ecs-benchmark-gaia-ecs-extended | ||
# NOTE: there can only be ONE suite (split into more execs) | ||
GaiaEcsBenchmarkSuite.cpp GaiaEcsBenchmarkSuite.h) | ||
target_include_directories( | ||
ecs-benchmark-gaia-ecs-extended | ||
PRIVATE "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>" "$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/${INCLUDE_DIR}>" | ||
"$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/${INCLUDE_DIR}>" "$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/${INCLUDE_DIR}>") | ||
target_link_libraries(ecs-benchmark-gaia-ecs-extended PRIVATE project_warnings project_options) | ||
target_link_libraries(ecs-benchmark-gaia-ecs-extended PRIVATE ecs-benchmark) | ||
|
||
# @NOTE: add libs for example here | ||
target_link_libraries(ecs-benchmark-gaia-ecs-extended PRIVATE ecs-benchmark-example-gaia-ecs) | ||
|
||
add_executable( | ||
ecs-benchmark-gaia-ecs-extended-soa | ||
# NOTE: there can only be ONE suite (split into more execs) | ||
GaiaEcsSoABenchmarkSuite.cpp GaiaEcsSoABenchmarkSuite.h) | ||
target_include_directories( | ||
ecs-benchmark-gaia-ecs-extended-soa | ||
PRIVATE "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>" "$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/${INCLUDE_DIR}>" | ||
"$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/${INCLUDE_DIR}>" "$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/${INCLUDE_DIR}>") | ||
target_link_libraries(ecs-benchmark-gaia-ecs-extended-soa PRIVATE project_warnings project_options) | ||
target_link_libraries(ecs-benchmark-gaia-ecs-extended-soa PRIVATE ecs-benchmark) | ||
|
||
# @NOTE: add libs for example here | ||
target_link_libraries(ecs-benchmark-gaia-ecs-extended-soa PRIVATE ecs-benchmark-example-gaia-ecs) |
9 changes: 9 additions & 0 deletions
9
benchmark/benchmarks/gaia-ecs-extended/GaiaEcsBenchmarkSuite.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#include "GaiaEcsBenchmarkSuite.h" | ||
|
||
static ecs::benchmarks::gaia_ecs::GaiaEcsBenchmarkSuite benchmark_suite({ | ||
.add_more_complex_system = true, | ||
.version = std::nullopt, | ||
}); | ||
|
||
ECS_COMPLEX_UPDATE_SYSTEMS_BENCHMARKS(benchmark_suite) | ||
ECS_ITERATE_COMPONENTS_BENCHMARKS(benchmark_suite) |
69 changes: 69 additions & 0 deletions
69
benchmark/benchmarks/gaia-ecs-extended/GaiaEcsBenchmarkSuite.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
#ifndef ECS_BENCHMARKS_GAIABENCHMARK_H_ | ||
#define ECS_BENCHMARKS_GAIABENCHMARK_H_ | ||
|
||
#include "ExtendedECSBenchmark.h" | ||
#include "gaia-ecs/GaiaEcsApplication.h" | ||
#include "gaia-ecs/entities/EntityFactory.h" | ||
#include "gaia-ecs/entities/HeroMonsterEntityFactory.h" | ||
#include "gaia-ecs/systems/DataSystem.h" | ||
#include "gaia-ecs/systems/MoreComplexSystem.h" | ||
#include "gaia-ecs/systems/MovementSystem.h" | ||
#include <utility> | ||
|
||
namespace ecs::benchmarks::gaia_ecs { | ||
|
||
class GaiaEcsBenchmarkSuite final | ||
: public ecs::benchmarks::base::ExtendedECSBenchmark<"gaia-ecs", GaiaEcsApplication, entities::EntityFactory, | ||
entities::HeroMonsterEntityFactory> { | ||
public: | ||
GaiaEcsBenchmarkSuite() = default; | ||
|
||
explicit GaiaEcsBenchmarkSuite(ecs::benchmarks::base::ESCBenchmarkOptions options) | ||
: ExtendedECSBenchmark(std::move(options)) {} | ||
|
||
void BM_IterateSingleComponent(benchmark::State& state) { | ||
using ComponentOne = ecs::benchmarks::base::components::PositionComponent; | ||
|
||
BM_IterateSingleComponentWithPreCreatedView( | ||
state, | ||
[](auto& world) { | ||
return world.query().template all<ComponentOne&>(); | ||
}, | ||
[&](ComponentOne& comp) { | ||
dummy_each(comp); | ||
}); | ||
} | ||
|
||
void BM_IterateTwoComponents(benchmark::State& state) { | ||
using ComponentOne = ecs::benchmarks::base::components::PositionComponent; | ||
using ComponentTwo = ecs::benchmarks::base::components::VelocityComponent; | ||
|
||
BM_IterateTwoComponentsWithPreCreatedView( | ||
state, | ||
[](auto& world) { | ||
return world.query().template all<ComponentOne&, ComponentTwo&>(); | ||
}, | ||
[&](ComponentOne& comp, ComponentTwo& comp2) { | ||
dummy_each(comp, comp2); | ||
}); | ||
} | ||
|
||
void BM_IterateThreeComponentsWithMixedEntities(benchmark::State& state) { | ||
using ComponentOne = ecs::benchmarks::base::components::PositionComponent; | ||
using ComponentTwo = ecs::benchmarks::base::components::VelocityComponent; | ||
using ComponentThree = ecs::benchmarks::base::components::DataComponent; | ||
|
||
BM_IterateThreeComponentsWithMixedEntitiesAndPreCreatedView( | ||
state, | ||
[](auto& world) { | ||
return world.query().template all<ComponentOne&, ComponentTwo&, ComponentThree&>(); | ||
}, | ||
[&](ComponentOne& comp, ComponentTwo& comp2, ComponentThree& comp3) { | ||
dummy_each(comp, comp2, comp3); | ||
}); | ||
} | ||
}; | ||
|
||
} // namespace ecs::benchmarks::gaia_ecs | ||
|
||
#endif |
9 changes: 9 additions & 0 deletions
9
benchmark/benchmarks/gaia-ecs-extended/GaiaEcsSoABenchmarkSuite.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#include "GaiaEcsSoABenchmarkSuite.h" | ||
|
||
static ecs::benchmarks::gaia_ecs::GaiaEcsSoABenchmarkSuite soa_benchmark_suite({ | ||
.add_more_complex_system = true, | ||
.version = std::nullopt, | ||
}); | ||
|
||
ECS_COMPLEX_UPDATE_SYSTEMS_BENCHMARKS(soa_benchmark_suite) | ||
// ECS_ITERATE_COMPONENTS_BENCHMARKS(soa_benchmark_suite) |
Oops, something went wrong.