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

Perf improvements in CCW creation. #739

Merged
merged 3 commits into from
Feb 16, 2021
Merged

Conversation

manodasanW
Copy link
Member

@manodasanW manodasanW commented Feb 16, 2021

  • Caching the vtable entries per type and as part of that also moving vtable cleanup to per type rather than per object.
  • Also moving to store IInspectableInfo per type rather than per object.

Based on a perf and memory analysis, it can be seen the memory consumption for storing the vtable entries is down as expected and in the repro scenario where CCW creation was found to be expensive, it is no longer near the top of the CPU usage and the execution time of the repro seems to have went down by half.

Fixes #438
Fixes #554

@AaronRobinsonMSFT
Copy link
Member

FYI @jkotas

@AaronRobinsonMSFT
Copy link
Member

Based on a perf and memory analysis, it can be seen the memory consumption for storing the vtable entries is down as expected and in the repro scenario where CCW creation was found to be expensive, it is no longer near the top of the CPU usage and the execution time of the repro seems to have went down by half.

@manodasanW I appreciate the following request may be annoying, but would it be possible to get a sense of the raw numbers we are looking at here? Like Scenario A vs Scenario B and then % improvement? Memory used and CPU usage are all that is interesting at the moment. It helps the .NET team talk about the investments we make in APIs and scenarios they unlock.

@manodasanW
Copy link
Member Author

Based on a perf and memory analysis, it can be seen the memory consumption for storing the vtable entries is down as expected and in the repro scenario where CCW creation was found to be expensive, it is no longer near the top of the CPU usage and the execution time of the repro seems to have went down by half.

@manodasanW I appreciate the following request may be annoying, but would it be possible to get a sense of the raw numbers we are looking at here? Like Scenario A vs Scenario B and then % improvement? Memory used and CPU usage are all that is interesting at the moment. It helps the .NET team talk about the investments we make in APIs and scenarios they unlock.

I plan on asking Bartek if he can do an updated run of this scenario which he has been tracking for various CsWinRT versions and the previous built-in version. I will also look at getting some metrics for memory usage.

@AaronRobinsonMSFT
Copy link
Member

I plan on asking Bartek if he can do an updated run of this scenario which he has been tracking for various CsWinRT versions and the previous built-in version. I will also look at getting some metrics for memory usage.

Perfect. That would be most insightful. Thanks!

@manodasanW manodasanW merged commit 4fa1fda into master Feb 16, 2021
@manodasanW manodasanW deleted the manodasanw/ccwcaching branch February 16, 2021 23:59
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.

VTable memory should be handled by Type not Object Improve perf of CreateCCWForObject by caching.
4 participants