diff options
author | Alec Thomas <alec@swapoff.org> | 2014-09-17 11:27:03 +1000 |
---|---|---|
committer | Alec Thomas <alec@swapoff.org> | 2014-09-17 11:27:03 +1000 |
commit | 96d5d0d1ac085f6c80777ff4801a2e97650354cf (patch) | |
tree | 69ef6381f6a56c11995f3221295432dc6bdc8a4c | |
parent | e48c78acdbec622074ea5ee5d2cf1a0798fdce60 (diff) |
In benchmark: only iterate once, not 10 times.
-rw-r--r-- | entityx/Benchmarks_test.cc | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/entityx/Benchmarks_test.cc b/entityx/Benchmarks_test.cc index c3e0ed3..bf0430b 100644 --- a/entityx/Benchmarks_test.cc +++ b/entityx/Benchmarks_test.cc @@ -107,19 +107,15 @@ TEST_CASE_METHOD(BenchmarkFixture, "TestDestroyEntitiesWithListener") { TEST_CASE_METHOD(BenchmarkFixture, "TestEntityIteration") { int count = 10000000; - vector<Entity> entities; for (int i = 0; i < count; i++) { auto e = em.create(); e.assign<Position>(); - entities.push_back(e); } AutoTimer t; - cout << "iterating over " << count << " entities with a component 10 times" << endl; + cout << "iterating over " << count << " entities, unpacking one component" << endl; ComponentHandle<Position> position; - for (int i = 0; i < 10; ++i) { - for (auto e : em.entities_with_components<Position>(position)) { - } + for (auto e : em.entities_with_components<Position>(position)) { } } |