#2725 closed enhancement (invalid)
[PATCH] Long range pathfinder performance improvements in AtGoal()
Reported by: | kanetaka | Owned by: | kanetaka |
---|---|---|---|
Priority: | Should Have | Milestone: | |
Component: | Core engine | Keywords: | patch |
Cc: | Patch: |
Description
The original AtGoal() calculates the distance to goal every time, but the distance can be got from heuristic cost. This routine is in main loop on CCmpPathfinder::ComputePath(), it requires optimization. To check my improvements, I added some profiling code in both the original and my patch and I have both codes run with replay mode. The commands.txt is from 1 human vs. 1 AI player's match. The result is:
HRT: using name=TSC freq=1796000000.P000000 HRT: counter=TSC freq=1.796e+009 res=5.56793e-010 bits=64 Original tc_AtGoal: 431.391 Mc (788205x) My patch tc_AtGoal: 67.5181 Mc (788205x)
The numbers of called are same, which implies this patch doesn't change pathfinding results. The performance improvements about 7 times faster.
Attachments (2)
Change History (6)
by , 10 years ago
Attachment: | AtGoal.patch added |
---|
by , 10 years ago
Attachment: | commands.txt added |
---|
follow-up: 2 comment:1 by , 10 years ago
comment:2 by , 10 years ago
Replying to stanislas69:
That's awesome, keep up the good work :) Do you think a 7time faster calculation would save up a lot of lag ?
As kanetaka wanted to say (but got rejected): No, 300 Mc gain is only 1/6 seconds per game. It might differ per game, but I'm not sure. Although I do not completely understand how the engine works, I guess the other components are the bottlenecks.
comment:3 by , 10 years ago
Keywords: | review removed |
---|---|
Resolution: | → invalid |
Status: | new → closed |
Uses floats in simulation code (breaks network sync). Also the pathfinder is in the process of being rewritten (as bad algorithms can't be fixed with micro-optimizations; and the current pathfinders have mismatches (which is the reason it is being rewritten)). It'd be nice if you'd help with the new wip pathfinder.
comment:4 by , 10 years ago
Milestone: | Alpha 17 |
---|
That's awesome, keep up the good work :) Do you think a 7time faster calculation would save up a lot of lag ?