-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Cleanup Admin Menu #15199
Cleanup Admin Menu #15199
Conversation
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.
While again I agree that it should be better, did you measure the impact?
src/OrchardCore/OrchardCore.Navigation.Core/NavigationHelper.cs
Outdated
Show resolved
Hide resolved
src/OrchardCore/OrchardCore.Admin.Abstractions/Models/AdminSettings.cs
Outdated
Show resolved
Hide resolved
src/OrchardCore.Modules/OrchardCore.Google/GoogleAuthenticationAdminMenu.cs
Show resolved
Hide resolved
@Piedone I did not measure the performance difference here. However, the |
I don't disagree, but since performance issues are complex and full of surprises, we shouldn't act solely on theory. |
@Piedone so you good with this PR? |
Not yet, we still need measurements. Knowing |
@Piedone not sure what you want to measure here. The rest of the changes either we remove the initialization completely, or we create an object once and reuse it every time. Do you have an idea for benchmarking that you want me to try? |
@Piedone I just did a benchmark to see how much memory allocation is saved over 100k requests one a single object initialization Does this paint the picture or are there a specific test you have in mind. Its actually quite nice to be able to see these number and the amount of memory allocation you save with small tricks. as simple as one constant variable saves 12mb in memory allocation over 100k requests. |
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.
Awesome!
This PR should reduce allocations and provide a slight better performance.
INavigationProvider
are called on every request to the admin page. So if we create new object every time, we have to create a new allocation every request for every client. So here we would reduce multiple allocations.Also, since the admin menu is something we call, there is no need to check for string invariant.
admin
andadminMenu