Jump to content

yeerk

Community Newbie
  • Posts

    1
  • Joined

  • Last visited

yeerk's Achievements

Tiro

Tiro (1/14)

1

Reputation

  1. Hey, I profiled 0ad with Very Sleepy and the following code path was causing the majority of my lag: CCmpPathfinder::ProcessSameTurnMoves CCmpPathfinder::ProcessLongRequests CCmpPathfinder::ComputePath ProcessNeighbour (CalculateHeuristic, but it is not in the stack, as it is inlined) isqrt64 The following patch basically eliminates this whole path from my profiles: https://gist.github.com/yeerkkiller1/b02d32c09e7f6c2685d9 . Basically the CFixedVector2D is unnecessary, as is using any sort of sqrt. I changed it to just return the distance squared, which still appears to satisfy the constraints of the function (it is still a heuristic). I played with this a few times online with someone else that has the same change applied, and I didn't run into any issues with this change. Lag will still occur with enough units, and the time is still spent in path finding, but the new bottleneck is inside ProcessShortRequests, ComputeShortPath, instead of ProcessLongRequests, ComputePath. Is there a place (other than this forum) I can submit this patch for review? Thanks! -- yeerk
×
×
  • Create New...