-
Notifications
You must be signed in to change notification settings - Fork 3
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
[REG-2191] Speedup game action analysis #360
Conversation
This improvement is huge though! Very impressed by the time save |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm sure this could use at least one more review from someone other than I, to give these changes a thorough check, but overall this is excellent
{ | ||
currentExpr = memberExpr.Expression; | ||
} else | ||
} | ||
else |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
most satisfying change of this PR
Edit: I see you change this a few times 👏🏻
var targetAssemblies = new List<Assembly>(GetTargetAssemblies()); | ||
for (int i = 0; i < targetAssemblies.Count; ++i) | ||
// some await to make this async on another thread right away | ||
await Task.CompletedTask; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would await Task.Yield()
have the same effect? Just curious
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it doesn't have exactly the same effect, but similar intent
await Task.Yield() will absolutely ensure you get a new synchronization context for the following lines (force them to run async)
await Task.completedTask is quite a bit faster to execute, but does not strictly guarantee a new context.. however, since I spawned an async task, i really just needed something to make that async code 'valid' (have an await)... based on how the code evolved I could even remove 1 or 2 of these and it work the same, but I left them in to ensure that future updates/modifications wouldn't un-expectedly change the threading behavior
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good to learn, thanks
Dramatically shortens the time required to analyze game actions
I was honestly hoping to get this down to single digit seconds for ALL games so that we could include it as a compile time trigger automatically. Sadly... that's just not possible for large games as we are limited by Unity's Main Thread access restrictions when doing game resource analysis.
Bossroom Before (~13 sec)
![RG_ACTION_ANALYSIS_PERF_OLD](https://private-user-images.githubusercontent.com/112959031/388591775-aaf8c94d-81dd-49b0-999e-eef0d45df3f5.jpg?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk1ODQyMDIsIm5iZiI6MTczOTU4MzkwMiwicGF0aCI6Ii8xMTI5NTkwMzEvMzg4NTkxNzc1LWFhZjhjOTRkLTgxZGQtNDliMC05OTllLWVlZjBkNDVkZjNmNS5qcGc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjE1JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIxNVQwMTQ1MDJaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0wZGExYThjYjFjN2ViN2YwNDhiYWUxZmM2ZWZlNDdjOTdkYTgyNTMwYTFlZmY0OWQ5MDM0ZjQ4YzBjMGU2NGE2JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.25mycezh7E-gEkdE2eBqvXSbCAAE9fW4mNfnVvk6z08)
Bossroom After (<4 sec)
![RG_ACTION_ANALYSIS_PERF_MultiThread](https://private-user-images.githubusercontent.com/112959031/388668094-2322a446-602d-48e2-9db7-b91fb0a25370.jpg?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk1ODQyMDIsIm5iZiI6MTczOTU4MzkwMiwicGF0aCI6Ii8xMTI5NTkwMzEvMzg4NjY4MDk0LTIzMjJhNDQ2LTYwMmQtNDhlMi05ZGI3LWI5MWZiMGE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E2MDEwZDdjM2E1ZGY1MTEzODZiMzc5ZjQzYjY2MzM5NmU1OGU4NTI4OGNlMWUyNzkxYWEzJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9._dC3StZJ0xJxjdhEaidfcjGTYGhMf_pFRzpp7exsFDw)
Large Customer Project after (<40 sec)
![RG_ACTION_ANALYSIS_PERF_cust_MultiThread](https://private-user-images.githubusercontent.com/112959031/388668024-b069178c-1899-494c-9ef4-7568fdebfd27.jpg?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk1ODQyMDIsIm5iZiI6MTczOTU4MzkwMiwicGF0aCI6Ii8xMTI5NTkwMzEvMzg4NjY4MDI0LWIwNjkxNzhjLTE4OTktNDk0Yy05ZWY0LTc1NjhmZGViZmQyNy5qcGc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjE1JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIxNVQwMTQ1MDJaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1hMWUxNDZmMzNlOTNlYWVjNzkyMTkzY2ZkYWZkYWEwYzRhM2M4NzYxMzIxNDIxMjY3MWM1MTA3NDQzY2FlOGE0JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.AN8ufOKwdksSYoa6gB12q__XLCNq3v-E1GibIrP7yJ4)
Find the pull request instructions here
Every reviewer and the owner of the PR should consider these points in their request (feel free to copy this checklist so you can fill it out yourself in the overall PR comment)