alias blame-lines="git ls-tree -r -z --name-only HEAD -- | egrep -z -Z -E '\.(scala)$'\
| xargs -0 -n1 git blame --line-porcelain | grep "^author "| sort | uniq -c | sort -nr"
author | commits | additions | deletions | blame lines |
Martin Odersky | 2,280 | 146,133 | 85,391 | 66,698 |
Dmitry Petrashko | 628 | 158,249 | 50,201 | 83,713 |
Samuel Gruetter | 19 | 62,324 | 12,510 | 36,615 |
Others | 144 | 5,315 | 2,108 | 4,161 |
Java | Scala |
|
|
45 msec | 872 msec |
| Java cycle body:
|
|
Scala cycle body:
|
val arr = (1 to 10000000).toArray
arr.reduce(_ + _).toDouble / arr.length
Java | Scala 2.11 | Scala 2.12.0-M3 | ScalaBlitz | Linker | ScalaJS + fullOpt | ScalaNative + Linker |
45ms | 872ms | 680ms | 42ms | 68ms1 | 2440ms | 0ms |
Java | Scala 2.11 | Scala 2.12.0-M3 | ScalaBlitz | Linker |
80ms | 240ms | 220ms | 310ms | 295ms1 |
|
|
Fast | Maintainable |
|
|
Rewrite rules | Macros & Inline | |
Defined | Anywhere in the program & libraries | inside implementation |
Applied | Based on analysis | Syntax only |
Influences typing | No | Yes |
Works with Java methods | Yes | No |
Works across libraries | Yes | No |
Best for | simple declarative rules | full-blown metaprogramming |
$ sbt test
+ Collections.twoFilters: OK, passed 100 tests.
+ Collections.isEmpty: OK, passed 100 tests.
+ Collections.twoDrops: OK, passed 100 tests.
+ Collections.mapFlatMap: OK, passed 100 tests.
+ Collections.mapMap: OK, passed 100 tests.