From 96d5d0d1ac085f6c80777ff4801a2e97650354cf Mon Sep 17 00:00:00 2001 From: Alec Thomas Date: Wed, 17 Sep 2014 11:27:03 +1000 Subject: In benchmark: only iterate once, not 10 times. --- entityx/Benchmarks_test.cc | 8 ++------ 1 file 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 entities; for (int i = 0; i < count; i++) { auto e = em.create(); e.assign(); - 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; - for (int i = 0; i < 10; ++i) { - for (auto e : em.entities_with_components(position)) { - } + for (auto e : em.entities_with_components(position)) { } } -- cgit v1.2.3