1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-10-31 00:07:39 +02:00

Added TODO's for potential optimizations that I've discovered

This commit is contained in:
Ivan Savenko
2024-07-04 07:59:50 +00:00
parent 075582910a
commit 41ed7e2e10
3 changed files with 3 additions and 2 deletions

View File

@@ -204,6 +204,7 @@ float HeroManager::getFightingStrengthCached(const CGHeroInstance * hero) const
{
auto cached = knownFightingStrength.find(hero->id);
//FIXME: fallback to hero->getFightingStrength() is VERY slow on higher difficulties (no object graph? map reveal?)
return cached != knownFightingStrength.end() ? cached->second : hero->getFightingStrength();
}

View File

@@ -212,7 +212,7 @@ void CaptureObjectsBehavior::decomposeObjects(
vstd::concatenate(tasksLocal, getVisitGoals(paths, nullkiller, objToVisit, specificObjects));
}
std::lock_guard<std::mutex> lock(sync);
std::lock_guard<std::mutex> lock(sync); // FIXME: consider using tbb::parallel_reduce instead to avoid mutex overhead
vstd::concatenate(result, tasksLocal);
});
}

View File

@@ -1231,7 +1231,7 @@ void RemoveObject::applyGs(CGameState *gs)
gs->map->instanceNames.erase(obj->instanceName);
gs->map->objects[objectID.getNum()].dellNull();
gs->map->calculateGuardingGreaturePositions();
gs->map->calculateGuardingGreaturePositions();//FIXME: excessive, update only affected tiles
}
static int getDir(const int3 & src, const int3 & dst)