-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Specialized observables for transitions #5953
Specialized observables for transitions #5953
Conversation
cc: @maxkatz6 Since you were changing that code lately as well. |
|
||
private TimeSpan? _previousTime; | ||
private TimeSpan _internalTime; | ||
|
||
protected ClockBase() | ||
{ | ||
_observable = new ClockObservable(); | ||
_connectedObservable = _observable.Publish().RefCount(); |
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.
Apart from adding 6 layers of indirection this was not doing anything useful. This observable does not initialize any resources when subscribed. I guess it was remnant of times where subscribing to clock was creating an actual timer.
Updated benchmarks after fixing invalid time easing. |
@MarchingCube I think, it can be backported to 0.10.x ? |
@maxkatz6 Yeah, in the current form it breaks no APIs and improves perf/readability of transition code. |
Specialized observables for transitions
What does the pull request do?
Reworked transitions to utilize custom observables, this eliminates several allocations and speeds up transitions,
Stack traces also look more sane (left = old, right = new). First one is for initial application of the transition, second one is for timer tick. I think timer tick can be cleaned up even further by replacing Rx setup with our specialized lightweight observable (since there are no threading concerns).
What is the current behavior?
What is the updated/expected behavior with this PR?
How was the solution implemented (if it's not obvious)?
Checklist
Breaking changes
Obsoletions / Deprecations
Fixed issues