3 ms·
As it already has been mentioned - Future's poor performance is mostly due redundant context switches on pretty much any operation. If you do `future.map((i: In
by UglyGenius 6y ago
As it already has been mentioned - Future's poor performance is mostly due redundant context switches on pretty much any operation. If you do `future.map((i: Int) => i + 1)` it can be executed on a different thread, which doesn't make much sense. It was the case in 2.11 stdlib and they're doing lots of improvements in this area, but Future still lags behind all widely-used "IO monads".
But put aside performance, any day of the week I'd choose ZIO (or Cats Effect IO or Monix Task) over Future even if ZIO was 10x slower. Amount of safety and composability "IO monads" give is outstanding.