Skip to content

fixed OutOfMemoryError in RxScala #1

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

Merged
merged 1 commit into from
Oct 12, 2016
Merged

Conversation

sbarlabanov
Copy link
Contributor

Since I am currently working with RxScala intensively I thought I could try to fix your example with RxScala ;).

  1. subscribeOn usage was wrong: subscribeOn does not distribute the calculations over multiple threads. It just hangs out the observable into another thread so the whole stream just runs in another single thread.
  2. toBlocking must be used to make the subscriber (foreach) to block. Otherwise foreach will not block and benchmark() just returns immediately.

P.S. on my Mac RxScala outperforms all others ;). But I did only 2 iterations instead of 20 ;). But to be more precise all examples have to be refactored a little bit to put initialization code out of benchmark() methods. e.g. execution context init and shutdown, Akka graph init, etc.

@jmhofer
Copy link
Owner

jmhofer commented Oct 12, 2016

Awesome, thanks for contributing this!

@jmhofer jmhofer merged commit 2ee5e41 into jmhofer:master Oct 12, 2016
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