New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ActorMap, do not look up influence node up to three times in cell layer. #20890
ActorMap, do not look up influence node up to three times in cell layer. #20890
Conversation
Will revert the second. |
9b7470b
to
30d95bd
Compare
Conceptual concerns regarding my measurements by @abcdefg30. |
i noticed that during shell map start up a lot calls to actor map find cell are being made (4000 or so). once the shell map plays it is less (500 each few many seconds). likely related to the orders being processed. i did look at the source of |
Looping the functions 1000x as follows is enough to get it to appear on a sampling profiler. I measured from start until RA shellmap had run for 1000 ticks. public SubCell FreeSubCell(CPos cell, SubCell preferredSubCell = SubCell.Any, bool checkTransient = true)
{
for (var i = 0; i < 1000; i++)
{
FreeSubCell2(cell, preferredSubCell, checkTransient);
}
return FreeSubCell2(cell, preferredSubCell, checkTransient);
SubCell FreeSubCell2(CPos cell, SubCell preferredSubCell, bool checkTransient)
{
// original method body
}
}
Once you undo the 1000x multiplier we're talking about methods that cost 0.002% of the runtime. Therefore we won't see any impact in timing logs. Any changes will be easily swamped in noise. Since this is a clean and straightforward change I am happy to approve it. In future it would be useful to outline the impact up front to set reviewer expectations. Changes with noticable impact are more likely to get attention that changes with unknown or no impact. |
partial successor of #20351, which will be closed.
in find free cell, avoid potential 3 times lookup of influence node in influence cell layer, by pasing the head influence node directly.
do no call function recursively to remove element from list. avoid cell layer cell update if head element did not change.