# The Reactive Scrabble benchmarks

DevFeed: [The Reactive Scrabble benchmarks](<https://devfeed.tech/articles/the-reactive-scrabble-benchmarks-24804.md>)

Original publisher: [Read original article](<https://akarnokd.blogspot.com/2016/12/the-reactive-scrabble-benchmarks.html>)

Author: David Karnok (noreply@blogger.com)

Published: 2016-12-27T19:01:00Z

Content type: article

Language: en

Sources: [Akarnokd - Advanced RxJava](<https://devfeed.tech/sources/akarnokd-advanced-rxjava.md>)

Topics: [Benchmark](<https://devfeed.tech/topics/benchmark.md>), [data-processing](<https://devfeed.tech/topics/data-processing.md>), [Java](<https://devfeed.tech/topics/java.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [benchmarks](<https://devfeed.tech/tags/benchmarks.md>), [data-processing](<https://devfeed.tech/tags/data-processing.md>), [java](<https://devfeed.tech/tags/java.md>), [performance](<https://devfeed.tech/tags/performance.md>), [reactive](<https://devfeed.tech/tags/reactive.md>), [scrabble](<https://devfeed.tech/tags/scrabble.md>), [streams](<https://devfeed.tech/tags/streams.md>)

## AI overview

This article explains the Shakespeare Plays (Reactive) Scrabble benchmark, including its purpose, computation, history, and sequential and parallel implementations. It discusses performance differences between RxJava and Java 8 Streams and describes efforts to improve RxJava 2 performance.

## Source excerpt

Introduction In the past year, I've been posting benchmark results under the mysterious Shakespeare Plays (Reactive) Scrabble name. In this blog post, I'll explain what this benchmark is, where does it come from, how it works, what the intent is and how to apply it to your favorite and not-yet-benchmarked library. History The benchmark was designed and developed by Jose Paumard and results presented in his 2015 Devoxx talk (a bit long but worth watching). The benchmark measures how fast a certain data-processing library can find the most valuable word from a set of words taken from (one of) Shakespeare's work based on the rules and point schema of Scrabble. RxJava at the time was in its 1.0.x version and to my surprise, it performed poorly compared to Java 8 Streams: https://youtu.be/fabN6HNZ2qY?t=8369 The benchmark, utilizing JMH, is completely synchronous; no thread hopping happens yet RxJava performs 10x slower, or more likely, it has 10x more overhead in the associated set of operators. In addition, Jose also added a parallel-stream version which runs the main "loop" in parallel before joining for the final result. More disappointingly, RxJava 2 developer preview the time was terrible as well (relatively, measured on a weak CPU in February). Therefore, instead of blaming the benchmark or the author, I set out on a quest to understand the benchmark's expectations and improve RxJava 2's performance and if possible, port that back to RxJava 1. The original Stream-benchmark Perhaps the most easy way to understand how the computation in the benchmark works, Let's see the original, non-parallel Stream version of it. Since going sequential or parallel requires only a sequential() or parallel() operator on a Stream, they both extend an abstract superclass containing the majority of the code and only get specialized for the operation mode in two additional classes. ShakespearePlaysScrabbleWithStreamBeta.java I added postfix "Beta" - meaning alternate version in this cont