-
Notifications
You must be signed in to change notification settings - Fork 29
Benchmarks: Dsl.scala vs Monix vs Cats Effect vs Scalaz Concurrent vs Scala Async vs Scala Continuation
杨博 (Yang Bo) edited this page May 8, 2018
·
26 revisions
We created some benchmarks to evaluate the computational performance of code generated by our compiler plug-in, especially, we are interesting how our !-notation and other direct style DSL affect the performance in an effect system that support both asynchronous and synchronous effects.
In spite of keywords of adapters to monads or other effect systems (see domain.cats and domain.scalaz), the preferred effect system for Dsl.scala is Task, the type alias of vanilla continuation-passing style function, defined as:
type !![Domain, Value] = (Value => Domain) => Domain
type TaskDomain = TailRec[Unit] !! Throwable
type Task[Value] = TaskDomain !! ValueOur benchmarks measured the performance of Task in Dsl.scala, along with other combination of effect system with direct style DSL, listed in the following table:
| Effect System | direct style DSL |
|---|---|
| Dsl.scala Task, an alias of vanilla continuation-passing style functions | !-notation provided by Dsl.scala |
| Scala Future | Scala Async |
| Scala Continuation library | Scala Continuation compiler plug-in |
| Monix tasks |
for comprehension |
| Cats effects | v comprehension |
| Scalaz Concurrent |
for comprehension |
TODO: incomplete