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

Ujjwalchadha/perf/eventsourcecodegen #852

Merged
merged 12 commits into from
Jun 9, 2021

Conversation

ujjwalchadha
Copy link
Contributor

@ujjwalchadha ujjwalchadha commented May 26, 2021

This PR improves the performance of subscribing to new events by removing the need for reflection. We precompute the handlers that the native code needs to invoke using the cswinrt code generator rather than compiling them at runtime using reflection. A new benchmark has been added to compute and compare the performance of an event being subscribed and invoked.

src/cswinrt/main.cpp Outdated Show resolved Hide resolved
@ujjwalchadha ujjwalchadha requested a review from manodasanW June 1, 2021 21:48
src/cswinrt/code_writers.h Outdated Show resolved Hide resolved
src/cswinrt/code_writers.h Outdated Show resolved Hide resolved
src/cswinrt/code_writers.h Outdated Show resolved Hide resolved
src/cswinrt/code_writers.h Outdated Show resolved Hide resolved
src/cswinrt/main.cpp Outdated Show resolved Hide resolved
src/cswinrt/main.cpp Outdated Show resolved Hide resolved
@@ -188,6 +192,7 @@ Where <spec> is one or more of:
continue;
}
auto guard{ w.push_generic_params(type.GenericParam()) };
auto guard1{ helperWriter.push_generic_params(type.GenericParam()) };
Copy link
Member

Choose a reason for hiding this comment

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

I don't think helperWriter is needed - you're only ever calling write_temp

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I believe we do need this because it is tied to the generic params that we set here. The write_temp functions uses the generic_params that we push to the helperWriter to write the type name and so on

Copy link
Member

@Scottj1s Scottj1s Jun 8, 2021

Choose a reason for hiding this comment

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

but w is pushing those very same generic params. can you try?

@ujjwalchadha ujjwalchadha requested a review from Scottj1s June 7, 2021 22:08
@ujjwalchadha ujjwalchadha requested a review from Scottj1s June 8, 2021 19:13
@ujjwalchadha ujjwalchadha merged commit 7c19930 into master Jun 9, 2021
@ujjwalchadha ujjwalchadha linked an issue Jun 15, 2021 that may be closed by this pull request
3 tasks
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.

Performance improvements to event sources
3 participants