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:
		| @@ -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(); | ||||
| } | ||||
|  | ||||
|   | ||||
| @@ -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); | ||||
| 		}); | ||||
| } | ||||
|   | ||||
| @@ -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) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user