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
szeiger@Stefans-MBP ~/code/dotty (master *=) | |
$ git clean -df | |
Removing dist-bootstrapped/ | |
Removing dotty-bootstrapped/ | |
Removing dotty-optimised/ | |
Removing project/project/project/ | |
Removing scala-compiler/ | |
Removing scala-library/ | |
Removing scala-reflect/ | |
Removing scalap/ |
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
[info] Benchmark (size) (stringsOnly) Mode Cnt Score Error Units | |
[info] HashMapBenchmark2.fill 0 false avgt 20 19.403 ± 0.136 ns/op | |
[info] HashMapBenchmark2.fill 1 false avgt 20 32.029 ± 0.360 ns/op | |
[info] HashMapBenchmark2.fill 10 false avgt 20 281.508 ± 3.443 ns/op | |
[info] HashMapBenchmark2.fill 100 false avgt 20 6840.049 ± 119.193 ns/op | |
[info] HashMapBenchmark2.fill 1000 false avgt 20 84998.278 ± 2454.868 ns/op | |
[info] HashMapBenchmark2.fill 10000 false avgt 20 924593.503 ± 13564.179 ns/op | |
[info] HashMapBenchmark2.getExisting 0 false avgt 20 0.631 ± 0.009 ns/op | |
[info] HashMapBenchmark2.getExisting 1 false avgt 20 13.986 ± 0.299 ns/op | |
[info] HashMapBenchmark2.getExisting 10 false avgt |
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
import scala.collection.immutable.HashMap$; | |
import scala.collection.immutable.HashMap; | |
import scala.collection.immutable.Map; | |
import scala.collection.mutable.Builder; | |
import scala.Tuple2; | |
public class JavaCallingScalaHashMap { | |
public static void main( String[] args ) { | |
Map<String, Integer> hashMap = HashMap$.MODULE$.empty(); |
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
[info] # Run progress: 91.67% complete, ETA 00:00:50 | |
[info] # Fork: 2 of 2 | |
[info] # Warmup Iteration 1: 94986.818 ns/op | |
[info] # Warmup Iteration 2: 90830.986 ns/op | |
[info] # Warmup Iteration 3: 90552.242 ns/op | |
[info] # Warmup Iteration 4: 93412.241 ns/op | |
[info] # Warmup Iteration 5: 90682.330 ns/op | |
[info] # Warmup Iteration 6: 92394.442 ns/op | |
[info] # Warmup Iteration 7: 95510.477 ns/op | |
[info] # Warmup Iteration 8: 92989.488 ns/op |
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
0394b8426ff src/library/scala/collection/immutable/LongMap.scala (Aleksandar Prokopec 2010-07-09 11:31:34 +0000 1) /* __ *\ | |
0394b8426ff src/library/scala/collection/immutable/LongMap.scala (Aleksandar Prokopec 2010-07-09 11:31:34 +0000 2) ** ________ ___ / / ___ Scala API ** | |
807dbe557a4 src/library/scala/collection/immutable/LongMap.scala (Heather Miller 2012-11-02 18:12:57 +0100 3) ** / __/ __// _ | / / / _ | (c) 2003-2013, LAMP/EPFL ** | |
0394b8426ff src/library/scala/collection/immutable/LongMap.scala (Aleksandar Prokopec 2010-07-09 11:31:34 +0000 4) ** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ ** | |
0394b8426ff src/library/scala/collection/immutable/LongMap.scala ( |
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
use std::ops::Add; | |
struct Point<T, U> { x: T, y: U } | |
impl<T : Add<Output=T>> Point<T, T> { | |
fn f(self) -> T { self.x + self.y } | |
} | |
fn main() { | |
Point { x: 1, y: 2.0 }.f(); |
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
scala> def f[C[_], E]: List[C[E]] = Nil | |
warning: there was one feature warning; re-run with -feature for details | |
f: [C[_], E]=> List[C[E]] | |
scala> f[List, Int] | |
res5: List[List[Int]] = List() | |
scala> f[Any, Int] | |
res6: List[Any] = List() |
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
public scala.Tuple2<java.lang.Object, java.lang.Object> find(int[][], int); | |
Code: | |
0: iconst_0 | |
1: istore_3 | |
2: iload_3 | |
3: aload_1 | |
4: arraylength | |
5: if_icmpge 60 | |
8: aload_1 | |
9: iload_3 |
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
def find(a: Array[Array[Int]], v: Int): (Int, Int) = { | |
var i = 0 | |
while(i < a.length) { | |
val aa = a(i) | |
var j = 0 | |
while(j < aa.length) { | |
if(aa(j) == v) return (i, j) | |
j += 1 | |
} | |
i += 1 |
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
def find(a: Array[Array[Int]], v: Int): (Int, Int) = { | |
var i = 0 | |
while(i < a.length) { | |
val aa = a(i) | |
var j = 0 | |
while(j < aa.length) { | |
if(aa(j) == v) return (i, j) | |
j += 1 | |
} | |
i += 1 |