DEV Community

Discussion on: Don't Drink Too Much Reactive Cool Aid

Collapse
 
samolenkov profile image
Stanislav Samolenkov • Edited
  1. The cost of thread is hugely eggxagerated.

  2. The modern server frameworks have graceful solutions to limit thread number and to use one thread for several parallel tasks.

ReactiveX cons:

  1. There are no methodologies to develop complex information systems based purely on Rx.

  2. The code is diveded by numerous lambdas and business logic is scattered across source files by small chunks. It's practically impossible to track particular use-case implementation across the sources.

  3. Given two above the eventual outcome of Rx development is chaotic development metaphor (see Steve McConnel).

  4. Thus it's not new or progressive but travelling in past times before OOAD of Booch, before GOF patterns, before RUP by Rational Rose and Three Friends. It's back to early 1990th.

Collapse
 
stealthmusic profile image
Jan Wedel

The cost of thread is hugely eggxagerated.

I admit, I did not do any testing on Desktop VMs recently. But, I was developing a platform for embedded clients running HotSpot VMs. We had around 200kB of memory available (not joking). So we needed to be very carful with any kind of memory usage. We actually removed all Strings in log messages and replaced them by constant numbers. Long story short, I measured the memory consumption of creating a thread (which we needed) and it was around 4kB. I did not dig deep into what it exactly consisted of but at that time it didn't matter.

So, do you have any solid figures for recent Desktop JVMs?

Collapse
 
samolenkov profile image
Stanislav Samolenkov

I worked on CORBA framework in the beginning of 2000th and then 1000 threads on server was no issue. All pros for reactivex are artificial. There are a lot of solutions how to reschedule the thread waiting on asychronous call for the other task. The task is made async and called from scheduler. The idea is the same as OS schedules processes and threads on the same CPU.