This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Results: | |
| Test Name | Time per round | Time in GC | Time in Benchmark | | |
|--------------------------------------------------+----------------+------------+-------------------| | |
| LinkedList Add only in front | 0.03 [+- 0.00] | 2.67 | 3.06 | | |
| LinkedList Add only in back | 0.03 [+- 0.01] | 2.61 | 3.01 | | |
| LinkedList Add in front and back | 0.03 [+- 0.00] | 2.66 | 3.16 | | |
| ArrayList Add only in front | 3.83 [+- 0.06] | 0.74 | 382.93 | | |
| ArrayList Add only in front with known size | 3.87 [+- 0.05] | 0.76 | 386.71 | | |
| ArrayList Add only in back | 0.01 [+- 0.01] | 0.69 | 0.87 | | |
| ArrayList Add only in back with known size | 0.01 [+- 0.01] | 0.76 | 0.93 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object ExtensionMethodsOnCompanionObjects { | |
implicit class ListFactoryOps(val list: List.type) extends AnyVal { | |
def fizzbuzz(n: Int): List[String] = | |
(0 to n).map { | |
case n if n % 15 == 0 => "FizzBuzz" | |
case n if n % 3 == 0 => "Fizz" | |
case n if n % 5 == 0 => "Buzz" | |
case n => n.toString | |
}.toList |