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

Save an allocation during inner observer creation in Switch. #619

Merged
merged 3 commits into from
Jun 25, 2018
Merged

Save an allocation during inner observer creation in Switch. #619

merged 3 commits into from
Jun 25, 2018

Conversation

danielcweber
Copy link
Collaborator

No description provided.

@glennawatson
Copy link

Hey if it's possible, can you add benchmarks like you did in your other PR? That was useful to see the results. I understand that's a bit of work so can understand if you decline to.

@danielcweber
Copy link
Collaborator Author

I added a benchmark that switches between 10000 observables.

Original:

               Method |     Mean |     Error |    StdDev |     Gen 0 | Allocated |
--------------------- |---------:|----------:|----------:|----------:|----------:|
 Switch_10000_Sources | 17.54 ms | 0.3283 ms | 0.3224 ms | 3656.2500 |   7.34 MB |


Less allocations:

               Method |     Mean |     Error |    StdDev |     Gen 0 | Allocated |
--------------------- |---------:|----------:|----------:|----------:|----------:|
 Switch_10000_Sources | 18.09 ms | 0.3541 ms | 0.5916 ms | 3531.2500 |   7.09 MB |

Copy link

@glennawatson glennawatson left a comment

Choose a reason for hiding this comment

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

The bench marks show that you have more fluctations with the increase in the standard deviation, with only a very slight decrease in terms of performance. I think it's good enough with the improvement to allocations.

@danielcweber danielcweber merged commit bec853b into dotnet:master Jun 25, 2018
@danielcweber danielcweber deleted the SaveAllocationInSwitch branch June 25, 2018 09:02
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.

2 participants