code size and performance optimizations (#472)

* Clean-up EntityManager a bit

- use tsl::robin_set instead of std::set (which should have been unordered::set
  anyways).

- getListeners() now returns a vector which avoids to traverse a set twice.
  Turns out that copying the set wasn't as efficient as I thought.

* Improve jobsystem a bit

We recently added a job reference counting mechanism, but we were a bit
too aggressive about taking/release references.

Also make the API more complete by adding explicit retain/release,
which is needed to allow several threads to wait on the same job.

Also improve futex code by inlining it.
This commit is contained in:
Mathias Agopian
2018-11-12 14:11:31 -08:00
committed by GitHub
parent 3407302954
commit bc3aee118a
13 changed files with 207 additions and 172 deletions
-5
View File
@@ -43,11 +43,6 @@ void EntityManager::destroy(size_t n, Entity* entities) noexcept {
static_cast<EntityManagerImpl *>(this)->destroy(n, entities);
}
void EntityManager::clear() noexcept {
static_cast<EntityManagerImpl *>(this)->clear();
}
void EntityManager::registerListener(EntityManager::Listener* l) noexcept {
static_cast<EntityManagerImpl *>(this)->registerListener(l);
}