Table Of Contents

  1. Suite Sleeps
  2. Suite Loops
  3. Suite Arithmetic Int
  4. Suite Arithmetic Double
  5. Suite Arithmetic BigDecimal64
  6. Suite Arithmetic BigDecimal128
  7. Suite Casts
  8. Suite Calls
  9. Suite List
  10. Suite List 2
  11. Suite Immutable Map
  12. Suite Immutable Map 2
  13. Suite Immutable Map 3
  14. Suite HashMap read
  15. Suite Large HashMap read
  16. Suite HashMap write
  17. Suite ConcurrentHashMap read
  18. Suite ConcurrentHashMap write
  19. Suite Large Immutable Map
  20. Suite Mutable Map
  21. Suite Large Mutable Map
  22. Suite Mutable Map2
  23. Suite Large Mutable Map2
  24. Suite Pattern Matching

Suite Sleeps

Sleeps for a specified time. Useful to verify the micro-benchmark framework.

Sleeps (Average of lowest 95%)
sleepSleeps for the specified amount of milliseconds.

Details about measurements in the details.


Suite Loops

This benchmark suite shows whether the compiler optimizes simple loops. If any of the benchmarks does not show linear cost, then the compiler optimizes it. This will probably impact other benchmarks as well.

Loops (Average of lowest 95%)
for loopAn empty for loop.
for loop resultA for loop that accumulates a result in a variable.
while loopA while loop that counts in a variable without returning a result.
while loop resultA while loop that accumulates a result in a variable.
do while loopA do-while loop that counts in a variable without returning a result.
do while loop resultA do-while loop that accumulates a result in a variable.

Details about measurements in the details.


Suite Arithmetic Int

Integer arithmetic operations.

Arithmetic Int (Average of lowest 95%)
for loopA for loop without calculations. This is the reference for the other benchmarks in this suite.
Int plusInteger addition.
Int minusInteger subtraction.
Int multInteger multiplication.
Int divInteger division.

Details about measurements in the details.


Suite Arithmetic Double

Integer arithmetic operations.

Arithmetic Double (Average of lowest 95%)
for loopA for loop without calculations. This is the reference for the other benchmarks in this suite.
Double plusDouble addition.
Double minusDouble subtraction.
Double multDouble multiplication.
Double divDouble division.

Details about measurements in the details.


Suite Arithmetic BigDecimal64

Arithmetic operations using a 64 bit math context (16 significant digits).

Arithmetic BigDecimal64 (Average of lowest 95%)
for loopA for loop without calculations. This is the reference for the other benchmarks in this suite.
BigDecimal plusBigDecimal addition.
BigDecimal minusBigDecimal subtraction.
BigDecimal multBigDecimal multiplication.
BigDecimal divBigDecimal division.

Details about measurements in the details.


Suite Arithmetic BigDecimal128

Arithmetic operations using a 128 bit math context (34 significant digits).

Arithmetic BigDecimal128 (Average of lowest 95%)
for loopA for loop without calculations. This is the reference for the other benchmarks in this suite.
BigDecimal plusBigDecimal addition.
BigDecimal minusBigDecimal subtraction.
BigDecimal multBigDecimal multiplication.
BigDecimal divBigDecimal division.

Details about measurements in the details.


Suite Casts

Compares the different ways casts can be implemented in Scala.

Casts (Average of lowest 95%)
asInstanceOfCasts a value using asInstanceOf.
match caseCasts a value using pattern matching with the type.

Details about measurements in the details.


Suite Calls

Compares the different type of calls in Scala. All calls will return the double integer value of its single integer argument. Example: def anotherMethod(x: Int) = x + x

Calls (Average of lowest 95%)
inlined loopA loop with the calculating code inlined.
methodCalls another method in the same class.
singletonMethodCalls a method in a singleton object. This corresponds to a static method in Java.
traitSingletonMethodCalls a method declared in a trait and implemented in a singleton object.
traitMethodImplCalls a method implemented in a trait.
traitInstanceMethodCalls a method declared in a trait and implemented in an anonymous local instance.
functionCalls a function.
closureCalls a closure with a bound variable.

Details about measurements in the details.


Suite List

List methods that operate on a single element.

List (Average of lowest 95%)
concatRightConcatenates two lists, where the left list has a single element.
appendHeadAppends a single element at the head of a list.

Details about measurements in the details.


Suite List 2

List methods that operate on all elements.

List 2 (Average of lowest 95%)
sortSorts a random list.
reverseReverses a list.
lengthCounts the elements in a list.
concatLeftConcatenates two lists, where the right list has a single element
appendTailAppends a single element at the tail end of a list.

Details about measurements in the details.


Suite Immutable Map

Immutable Map methods that operate on a single element.

Immutable Map (Average of lowest 95%)
contains trueChecks that a map really contains a value.
contains falseChecks that a map really does not contain a value.
+Adds a new entry to a map.
-Removes an existing entry from a map.

Details about measurements in the details.


Suite Immutable Map 2

Immutable Map methods that operate on all elements.

Immutable Map 2 (Average of lowest 95%)
filterKeysFilters a map by removing all odd keys.

Details about measurements in the details.


Suite Immutable Map 3

Immutable Map methods that operate on all elements.

Immutable Map 3 (Average of lowest 95%)
filterKeysFilters a map by removing all odd keys.

Details about measurements in the details.


Suite HashMap read

Basic HashMap methods.

HashMap read (Average of lowest 95%)
contains trueChecks that a map really contains a value.
contains falseChecks that a map really does not contain a value.
sizeCalculates the size of a map.

Details about measurements in the details.


Suite Large HashMap read

Basic HashMap methods.

Large HashMap read (Average of lowest 95%)
contains trueChecks that a map really contains a value.
contains falseChecks that a map really does not contain a value.
sizeCalculates the size of a map.

Details about measurements in the details.


Suite HashMap write

Basic HashMap methods.

HashMap write (Average of lowest 95%)
putAdds a new entry to a map.
removeRemoves an existing entry from a map.
clearRemoves all entries from a map.

Details about measurements in the details.


Suite ConcurrentHashMap read

ConcurrentHashMap methods that read from the map.

ConcurrentHashMap read (Average of lowest 95%)
contains trueChecks that a map really contains a value.
contains falseChecks that a map really does not contain a value.
sizeCalculates the size of a map.

Details about measurements in the details.


Suite ConcurrentHashMap write

ConcurrentHashMap methods that write into the map.

ConcurrentHashMap write (Average of lowest 95%)
removeRemoves an existing entry from a map.
putAdds a new entry to a map.
clearRemoves all entries from a map.

Details about measurements in the details.


Suite Large Immutable Map

Immutable Map methods with a large map.

Large Immutable Map (Average of lowest 95%)
contains trueChecks that a map really contains a value.
contains falseChecks that a map really does not contain a value.
+Adds a new entry to a map.
-Removes an existing entry from a map.

Details about measurements in the details.


Suite Mutable Map

Mutable Map methods that operate on a single element.

Mutable Map (Average of lowest 95%)
contains trueChecks that a map really contains a value.
contains falseChecks that a map really does not contain a value.
+=Adds a new entry to a map.
-=Removes an existing entry from a map.

Details about measurements in the details.


Suite Large Mutable Map

Mutable Map methods that operate on a single element.

Large Mutable Map (Average of lowest 95%)
contains trueChecks that a map really contains a value.
contains falseChecks that a map really does not contain a value.
+=Adds a new entry to a map.
-=Removes an existing entry from a map.

Details about measurements in the details.


Suite Mutable Map2

Mutable Map methods that operate on all elements.

Mutable Map2 (Average of lowest 95%)
filterKeysFilters a map by removing all odd keys.

Details about measurements in the details.


Suite Large Mutable Map2

Mutable Map methods that operate on all elements.

Large Mutable Map2 (Average of lowest 95%)
filterKeysFilters a map by removing all odd keys.

Details about measurements in the details.


Suite Pattern Matching

Different examples for pattern matching and equivalent code.

Pattern Matching (Average of lowest 95%)
match 1Matches the 1st pattern with a literal integer value.
if 1Matches the 1st if in an if-else cascade with integer values.
match 5Matches the 5th pattern with a literal integer value.
if 5Matches the 5th if in an if-else cascade with integer values.

Details about measurements in the details.