summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJosh Suereth <Joshua.Suereth@gmail.com>2012-06-18 12:29:24 -0700
committerJosh Suereth <Joshua.Suereth@gmail.com>2012-06-18 12:29:24 -0700
commit7ee46cc766539c9e8c287c29170657c55b3e158e (patch)
treef2326f444463f0c344f96e061e6fea084e4fa2f3 /test
parentbf4b982389dcd573e81155bfe233f70f1471b017 (diff)
parent6f5979f00118e19b1e3e143d366f2d6029a63466 (diff)
downloadscala-7ee46cc766539c9e8c287c29170657c55b3e158e.tar.gz
scala-7ee46cc766539c9e8c287c29170657c55b3e158e.tar.bz2
scala-7ee46cc766539c9e8c287c29170657c55b3e158e.zip
Merge pull request #742 from axel22/feature/pc-ctrie
Use `ThreadLocalRandom` in `TrieMap.size`.
Diffstat (limited to 'test')
-rw-r--r--test/benchmarking/ParCtrie-size.scala11
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
}
}