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

Cache trait look-ups in Armament #13527

Merged
merged 3 commits into from Jun 22, 2017

Conversation

Projects
None yet
6 participants
@reaperrr
Contributor

reaperrr commented Jun 17, 2017

On bleed, a total of six TraitsImplementing look-ups were performed for every burst.
Now they're cached at actor creation and only relevant IsEnabled/GetModifier look-ups are performed per shot.
This might save a little performance during heated battles.

@rob-v

I propose to cache also remaining INotifyAttack traits used in 2 loops.

Show outdated Hide outdated OpenRA.Mods.Common/Traits/Armament.cs
@reaperrr

This comment has been minimized.

Show comment
Hide comment
@reaperrr

reaperrr Jun 18, 2017

Contributor

Updated.
Additionally, added caching for traits implementing INotifyAttack.

Contributor

reaperrr commented Jun 18, 2017

Updated.
Additionally, added caching for traits implementing INotifyAttack.

@rob-v

rob-v approved these changes Jun 18, 2017

👍

@atlimit8 atlimit8 merged commit 8e9f20c into OpenRA:bleed Jun 22, 2017

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@atlimit8

This comment has been minimized.

Show comment
Hide comment
@atlimit8
Member

atlimit8 commented Jun 22, 2017

@reaperrr reaperrr deleted the reaperrr:ArmamentCaching branch Jul 23, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment