-
Notifications
You must be signed in to change notification settings - Fork 754
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 allocations in Zip #635
Save allocations in Zip #635
Conversation
Can we get BenchmarkDotnet wired up for these? There's quite a few perf optimizations and it'd be useful to have a before/after that shows the difference. |
That would be very cool, I'll have a look into this. |
Would you prefer some local benchmark results (as some kind of proof) in the PR or rather have the benchmarks part of the CI build ? |
Here we go. Again, we don't see that big a boost here, but another benefit of less allocations is that GC may kick in later and less often, which is not reflected in this benchmark.
|
I'm not sure that benchmarks in a CI build would be really useful given how much it depends on the machine load. I think having it in the PR as a reference is helpful though |
Agreed, and builds would take forever. Do you have experience with interpreting the benchmarks? Comparison of the mean is not so impressive but the standard deviation would suggest that the measurements are much less flaky, maybe that's the GC kicking in less frequently? |
I would nerd-snipe @benaadams here |
|
||
namespace Benchmarks.System.Reactive | ||
{ | ||
public class ZipBenchmark |
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.
Add the attribute [MemoryDiagnoser]
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 run again and it should show the allocations
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.
@benaadams Awesome, thanks!
Results with
Allocation performance has improved, time performance has not. |
@cabauman thx for review and welcome! |
Thanks @danielcweber! I haven't posted much in the rxnet slack room but I've been observing from a distance for quite some time. Love what you guys are doing. At the very least, I'll make it a point to do some more reviews. |
…ignmentDisposables currently used. We save n allocations for the n-ary Zip.
…aves the allocation of an anonymous disposable, a closure and a delegate.
A lot of SingleAssignmentDisposables can be saved in Zip.