David Karnok

Results 195 comments of David Karnok

> I thought you weren't concerned with queue performance, just wanted a known quantity With our Spsc, it's more about allocation than queue performance at the moment. SpscAtomicArrayQueue allocates 1...

I've run a [comparison benchmark](https://github.com/akarnokd/akarnokd-misc/blob/master/src/jmh/java/hu/akarnokd/queue/QueuePerf.java) and got [interesting results](https://gist.github.com/akarnokd/b34fb93e6d2bd2c73738). ![image](https://cloud.githubusercontent.com/assets/1269832/13429553/1c3aaa12-dfc1-11e5-945e-9b2bbc24b18a.png) with errors: ![image](https://cloud.githubusercontent.com/assets/1269832/13429708/bd188b5c-dfc1-11e5-8f7f-92743071c2cd.png) I expected unsafe to be better, but I'm surprised how the growable and unbounded variants do even...

It seems the main source of lost throughput was the index trashing: ![image](https://cloud.githubusercontent.com/assets/1269832/13431830/4d1fbb04-dfcb-11e5-8334-d9c7b6f8a5db.png) The `rsc` column is the original plain SpscArrayQueue, the `rsc1` had just item padding and the `rsc2`...

Gem 22 handles the case when there is a subscriber but it hasn't called `request()` yet. `fromCallable` runs immediately but defers the emission. This gem defers the execution because the...

Updated the gem to show the effect if the request is actually delayed.

1) What happens if you run the following code? ``` java Observable.empty().repeat().subscribe(); ``` [ ] Nothing, completes normally [ ] Throws `MissingBackpressureException` [ ] Throws `OnErrorNotImplementedException` [X] Goes into an...

2) What happens when you run the following code? ``` java PublishSubject ps = PublishSubject.create(); ps.subscribeOn(Schedulers.computation()).subscribe(v -> System.out.println(Thread.currentThread.getName())); Thread.sleep(1000); ps.onNext(1); ``` [X] Prints `main` [ ] Prints `1` [ ]...

# 1) The merge/flatMap identity The operators `merge` and `flatMap` are closely related and you can implement one with the other: Given a nested `Publisher`, merging them is equivalent of...

# 2) Compose at subscription time Modern reactive libraries offer you fluent conversion operators: `extend`, `to`, `as` or `compose`. You can then apply your own transformative function which runs in...

# 3) FlatMap as map or filter The operator `flatMap` very versatile and comes up frequently when one wants to join different mapped sequences. The mapper function let's you return...