As I said before, in the first version the benchmarks were very basic using just System.currentTimeInMillis and println because the idea was to give you a basic point of view about the alternatives to the standard Scala Futures by the creation of a simple scenario (and because I didn’t have so much time to create the benchmarks properly). And I have to say that the basic benchmarks are not so far from the real ones…
This simple scenario consists in the sum of three different square roots of a double by using Futures and measure the average time taken by the three different ways to do it: Future for-comprehension, Future.sequence and async-await.
Running 3 iterations, 10 warmup iterations, 3 forks and 1 thread
The async-await is the fastest approach performing every operation in just 2026.783 nanoseconds followed by the future for-comprehension approach taking 7116.502 nanoseconds per operation.
Running 20 iterations, 20 warmup iterations, 10 forks and 1 thread
The async-await is again the fastest approach performing every operation in just 1999.398 nanoseconds.
To see the full results take a look at the README file of the project in the microbenchmark-harness branch.
I had this pending task after a few people were interested in have the results of a reliable benchmark like JMH. So here I came back with some results. I hope you like it!
Until next post!