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

Simple ability self profiler #1046

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

robojumper
Copy link
Member

Helps towards #1044.

@Xymanek suggested:

add an array to CHHelpers for ability templates to force usage of script GAT (XCGS_A_CH), so that we can see what exact part of logic is spending so much time. The DoesBlockUnitPathing calls makes me suspect that we are actually spending the time in X2AbilityTarget_MovingMelee/pathfinding

@robojumper
Copy link
Member Author

Flash of inspiration: We don't strictly need XCGS_A_CH for profiling -- we can just add a denativized GatherAbilityTargets function with a different name that's called for specific abilities instead. We can even add code to record the number of initial targets, filtered targets etc.

@@ -384,6 +393,105 @@ simulated function int SortAvailableTargets(AvailableTarget TargetA, AvailableTa
}
*/

simulated function name CHGatherAbilityTargetsScript(out array<AvailableTarget> Targets, optional XComGameState_Unit OverrideOwnerState)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note to self: This should be final.

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