-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Rid of TypeResolver.ResolveType() call from Process_Types_Ps1Xml() #16349
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
Conversation
| try | ||
| { | ||
| IdentityReference? ir = sd.GetOwner(typeof(NTAccount)); | ||
| return ir?.ToString(); |
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.
Now it can return a null instead of null reference exception. What is original design here?
| try | ||
| { | ||
| IdentityReference? ir = sd.GetGroup(typeof(NTAccount)); | ||
| return ir?.ToString(); |
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.
Now it can return a null instead of null reference exception. What is original design here?
| } | ||
| } | ||
|
|
||
| #if !CORECLR |
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.
Makes sense to remove the code?
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.
Or enable for IsWindowsDesktop?
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.
The code shouldn't be removed. It was enclosed by CORECLR because the Win32 API LsaQueryCAPs was not available on NanoServer. Now it should be enabled in theory. I think we need @TravisEz13 or @PaulHigin to take a look.
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.
Thanks! Docs say the API is on Windows 8/2012+ desktop apps only.
https://docs.microsoft.com/en-us/windows/win32/api/ntlsa/nf-ntlsa-lsaquerycaps
|
I don't think this is what we want. We want to split S.M.A, instead of moving more stuff to it. Resolving types and thus loading an assembly like this is inevitable when getting S.M.A.dll leaner. |
|
This is the easiest thing I could do quickly with hope to get this in 7.2. :-) |
|
This PR has Quantification details
Why proper sizing of changes matters
Optimal pull request sizes drive a better predictable PR flow as they strike a
What can I do to optimize my changes
How to interpret the change counts in git diff output
Was this comment helpful? 👍 :ok_hand: :thumbsdown: (Email) |
|
Performance changes won't meet the bar to be ported to the 7.2 GA release branch at this point. Only fix to regressions or build-n-packaging will be considered. |
|
@daxian-dbw Could you please look my questions above for the old code? Makes sense to fix this? |
PR Summary
Rid of
TypeResolver.ResolveType()call fromProcess_Types_Ps1Xml().Perf win at startup scenario is ~9%.
All static methods from SecurityDescriptorCommandsBase class are moved to new SecurityDescriptorCommandsHelperBase class in SMA. This allows to directly reference the static methods from
Process_Types_Ps1Xml().PR Context
I was very surprised to discover that there is only one call of TypeResolver.ResolveType() in Process_Types_Ps1Xml which does the huge delay at startup scenario.
Before the PR:

After the PR:

In future I think it makes sense to improve a performance of TypeResolver.ResolveType() itself. While a cache is empty the method does very expensive assembly enumeration. I guess we could pre-build the cache at compile time for well-known assemblies and get perf wins for some scenarios.
PR Checklist
.h,.cpp,.cs,.ps1and.psm1files have the correct copyright headerWIP:or[ WIP ]to the beginning of the title (theWIPbot will keep its status check atPendingwhile the prefix is present) and remove the prefix when the PR is ready.(which runs in a different PS Host).