Index: binaries/data/mods/public/simulation/components/Timer.js =================================================================== --- binaries/data/mods/public/simulation/components/Timer.js +++ binaries/data/mods/public/simulation/components/Timer.js @@ -119,6 +119,7 @@ run.push(id); }); + Engine.ProfileStart("Timer::OnUpdate"); for (let id of run) { let timer = this.timers.get(id); @@ -162,6 +163,7 @@ if (timer.time <= this.time) run.push(id); } + Engine.ProfileStop("Timer::OnUpdate"); }; Engine.RegisterSystemComponentType(IID_Timer, "Timer", Timer); Index: source/ps/Profiler2.cpp =================================================================== --- source/ps/Profiler2.cpp +++ source/ps/Profiler2.cpp @@ -46,7 +46,7 @@ const size_t CProfiler2::MAX_ATTRIBUTE_LENGTH = 256; // TODO: what's a good size? -const size_t CProfiler2::BUFFER_SIZE = 4 * 1024 * 1024; +const size_t CProfiler2::BUFFER_SIZE = 8 * 1024 * 1024; const size_t CProfiler2::HOLD_BUFFER_SIZE = 128 * 1024; // A human-recognisable pattern (for debugging) followed by random bytes (for uniqueness) Index: source/simulation2/components/CCmpPathfinder.cpp =================================================================== --- source/simulation2/components/CCmpPathfinder.cpp +++ source/simulation2/components/CCmpPathfinder.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2022 Wildfire Games. +/* Copyright (C) 2023 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -802,11 +802,14 @@ } // We're done, clear futures. // Use CancelOrWait instead of just Cancel to ensure determinism. - for (Future& future : m_Futures) - future.CancelOrWait(); + { + PROFILE2("WaitingForAsyncPaths"); + for (Future& future : m_Futures) + future.CancelOrWait(); + } { - PROFILE2("PostMessages"); + PROFILE2("PostPathMessages"); for (PathResult& path : m_ShortPathRequests.m_Results) { CMessagePathResult msg(path.ticket, path.path); @@ -861,8 +864,6 @@ entity_pos_t x0, entity_pos_t z0, entity_pos_t x1, entity_pos_t z1, entity_pos_t r, pass_class_t passClass) const { - PROFILE2_IFSPIKE("Check Movement", 0.001); - // Test against obstructions first. filter may discard pathfinding-blocking obstructions. // Use more permissive version of TestLine to allow unit-unit collisions to overlap slightly. // This makes movement smoother and more natural for units, overall. Index: source/simulation2/system/ComponentManager.cpp =================================================================== --- source/simulation2/system/ComponentManager.cpp +++ source/simulation2/system/ComponentManager.cpp @@ -1014,8 +1014,6 @@ void CComponentManager::PostMessage(entity_id_t ent, const CMessage& msg) { - PROFILE2_IFSPIKE("Post Message", 0.0005); - PROFILE2_ATTR("%s", msg.GetScriptHandlerName()); // Send the message to components of ent, that subscribed locally to this message std::map >::const_iterator it; it = m_LocalMessageSubscriptions.find(msg.GetType()); @@ -1066,8 +1064,6 @@ void CComponentManager::SendGlobalMessage(entity_id_t ent, const CMessage& msg) { - PROFILE2_IFSPIKE("SendGlobalMessage", 0.001); - PROFILE2_ATTR("%s", msg.GetScriptHandlerName()); // (Common functionality for PostMessage and BroadcastMessage) // Send the message to components of all entities that subscribed globally to this message