diff options
author | Aleksandar Prokopec <axel22@gmail.com> | 2012-06-18 18:09:12 +0200 |
---|---|---|
committer | Aleksandar Prokopec <axel22@gmail.com> | 2012-06-18 18:36:41 +0200 |
commit | 6f5979f00118e19b1e3e143d366f2d6029a63466 (patch) | |
tree | a9eaabd660ca3f6a0853a60c8dfd2bc60dbb49fe /test | |
parent | 9a28ee1ffc085bc680c48b12ad632b9133adf020 (diff) | |
download | scala-6f5979f00118e19b1e3e143d366f2d6029a63466.tar.gz scala-6f5979f00118e19b1e3e143d366f2d6029a63466.tar.bz2 scala-6f5979f00118e19b1e3e143d366f2d6029a63466.zip |
Use `ThreadLocalRandom` in `TrieMap.size`.
Diffstat (limited to 'test')
-rw-r--r-- | test/benchmarking/ParCtrie-size.scala | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/test/benchmarking/ParCtrie-size.scala b/test/benchmarking/ParCtrie-size.scala index 5a6191fb62..3f47dc23fd 100644 --- a/test/benchmarking/ParCtrie-size.scala +++ b/test/benchmarking/ParCtrie-size.scala @@ -2,16 +2,18 @@ -import collection.parallel.mutable.ParCtrie +import collection.parallel.mutable.ParTrieMap object Size extends testing.Benchmark { val length = sys.props("length").toInt val par = sys.props("par").toInt - var parctrie = ParCtrie((0 until length) zip (0 until length): _*) + var parctrie = ParTrieMap((0 until length) zip (0 until length): _*) - collection.parallel.ForkJoinTasks.defaultForkJoinPool.setParallelism(par) + //collection.parallel.ForkJoinTasks.defaultForkJoinPool.setParallelism(par) + val ts = new collection.parallel.ForkJoinTaskSupport(new concurrent.forkjoin.ForkJoinPool(par)) + parctrie.tasksupport = ts def run = { parctrie.size @@ -21,7 +23,8 @@ object Size extends testing.Benchmark { override def tearDown() { iteration += 1 - if (iteration % 4 == 0) parctrie = ParCtrie((0 until length) zip (0 until length): _*) + if (iteration % 4 == 0) parctrie = ParTrieMap((0 until length) zip (0 until length): _*) + parctrie.tasksupport = ts } } |