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

Removed window between the two synchronized blocks. #1012

Merged
merged 1 commit into from
Apr 2, 2014

Conversation

akarnokd
Copy link
Member

@akarnokd akarnokd commented Apr 2, 2014

In the original version, there was a window between finding a null queue and setting emitting false due to being in different synchronized block. If another thread came in this window, it created a new queue with its event which was not emitted until another onXXX method was called, causing unnecessary event delivery delay.

While running the tests, the SerializedObserverTest.testNotificationDelay failed from time to time due to thread timing. I haven't fixed this test.

@cloudbees-pull-request-builder

RxJava-pull-requests #939 ABORTED

@akarnokd
Copy link
Member Author

akarnokd commented Apr 2, 2014

Strange. contrib-quasar tests pass in timely manner on my local machine.

@benjchristensen
Copy link
Member

Thanks for this, looks good.

benjchristensen added a commit that referenced this pull request Apr 2, 2014
Removed window between the two synchronized blocks.
@benjchristensen benjchristensen merged commit 803f5e3 into ReactiveX:master Apr 2, 2014
@benjchristensen
Copy link
Member

Benchmarks suggest no meaningful change ... which is good, as this should have been a change for a case not covered in these tests.

Benchmark                                                  (size)   Mode   Samples         Mean   Mean error    Units
r.o.OperatorSerializePerf.noSerializationSingleThreaded      1024   avgt         5       45.329        1.851    ns/op
r.o.OperatorSerializePerf.noSerializationSingleThreaded   1048576   avgt         5       57.587        3.061    ns/op
r.o.OperatorSerializePerf.serializedSingleStream             1024   avgt         5       67.744        2.928    ns/op
r.o.OperatorSerializePerf.serializedSingleStream          1048576   avgt         5       73.889        2.139    ns/op
r.o.OperatorSerializePerf.synchronizedSingleStream           1024   avgt         5       72.970        3.083    ns/op
r.o.OperatorSerializePerf.synchronizedSingleStream        1048576   avgt         5       76.640        1.677    ns/op

compared with 0.17.3

Benchmark                                                          (size)   Mode   Samples         Mean   Mean error    Units
r.operators.OperatorSerializePerf.noSerializationSingleThreaded      1024   avgt         5       45.504        1.710    ns/op
r.operators.OperatorSerializePerf.noSerializationSingleThreaded   1048576   avgt         5       58.600        5.647    ns/op
r.operators.OperatorSerializePerf.serializedSingleStream             1024   avgt         5       68.610        4.596    ns/op
r.operators.OperatorSerializePerf.serializedSingleStream          1048576   avgt         5       71.313        2.318    ns/op
r.operators.OperatorSerializePerf.synchronizedSingleStream           1024   avgt         5       73.322        3.666    ns/op
r.operators.OperatorSerializePerf.synchronizedSingleStream        1048576   avgt         5       76.518        1.355    ns/op

@akarnokd akarnokd deleted the SerializedObserverFix2 branch May 6, 2014 13:39
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.

None yet

3 participants