Skip to content
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

More perf fixes: #11

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

More perf fixes: #11

wants to merge 1 commit into from

Conversation

wmtorode
Copy link
Member

@wmtorode wmtorode commented Feb 1, 2025

  • BA was also using a tagset to check if it could swarm, this is now replaced with an injected field for best perf.

  • replaced resupply unit stats collection check with an injected field, this should further improve resupply perf.

  • GetAllFriendlies is doing an unneeded IsDead check because GetAllLivingActors is already doing that. Given that it returns a new list and uses a findall, I swapped this instead for using the allActors property, so we only have to do 1 iteration over the list of actors. This also saves a new list being created and reduces the number of calls of IsDead by 1 per actor per call of GetAllFriendlies, which is frequently called.

- BA was also using a tagset to check if it could swarm, this is now replaced with an injected field for best perf.

- replaced resupply unit stats collection check with an injected field, this should further improve resupply perf.

- GetAllFriendlies is doing an unneeded IsDead check because GetAllLivingActors is already doing that. Given that it returns a new list and uses a findall, I swapped this instead for using the allActors property, so we only have to do 1 iteration over the list of actors. This also saves a new list being created and reduces the number of calls of IsDead by 1 per actor per call of GetAllFriendlies, which is frequently called.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant