Skip to content

Commit 96d5d0d

Browse files
committed
In benchmark: only iterate once, not 10 times.
1 parent e48c78a commit 96d5d0d

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

entityx/Benchmarks_test.cc

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -107,19 +107,15 @@ TEST_CASE_METHOD(BenchmarkFixture, "TestDestroyEntitiesWithListener") {
107107

108108
TEST_CASE_METHOD(BenchmarkFixture, "TestEntityIteration") {
109109
int count = 10000000;
110-
vector<Entity> entities;
111110
for (int i = 0; i < count; i++) {
112111
auto e = em.create();
113112
e.assign<Position>();
114-
entities.push_back(e);
115113
}
116114

117115
AutoTimer t;
118-
cout << "iterating over " << count << " entities with a component 10 times" << endl;
116+
cout << "iterating over " << count << " entities, unpacking one component" << endl;
119117

120118
ComponentHandle<Position> position;
121-
for (int i = 0; i < 10; ++i) {
122-
for (auto e : em.entities_with_components<Position>(position)) {
123-
}
119+
for (auto e : em.entities_with_components<Position>(position)) {
124120
}
125121
}

0 commit comments

Comments
 (0)