Author: Remi Meier <[email protected]>
Branch: multithread-runner
Changeset: r382:5f5a5345c51c
Date: 2016-07-14 09:47 +0200
http://bitbucket.org/pypy/benchmarks/changeset/5f5a5345c51c/
Log: initial adaption for running multithreaded on JIT
diff --git a/multithread/btree/btree.py b/multithread/btree/btree.py
--- a/multithread/btree/btree.py
+++ b/multithread/btree/btree.py
@@ -312,7 +312,7 @@
######################################################################
CONFLICTING = [BTree.insert, BTree.remove]
-OPS = [BTree.__contains__] * 198 + CONFLICTING
+OPS = [BTree.__contains__] * 1998 + CONFLICTING
ITEM_RANGE = 10000
diff --git a/multithread/config-all-long.json b/multithread/config-all-long.json
new file mode 100644
--- /dev/null
+++ b/multithread/config-all-long.json
@@ -0,0 +1,68 @@
+{
+ "defaults": {
+ "file": null,
+ "threads": [1, 2, 4, 8],
+ "vmstarts": 1,
+ "warmiters": 1,
+ "PYTHONPATH": ".",
+ "args": [],
+ "cwd": "."
+ },
+
+ "benchs": {
+ "nqueens": {
+ "file": "nqueens/nqueens.py",
+ "PYTHONPATH": "..",
+ "args": ["10"]
+ },
+
+ "parsible-bench": {
+ "file": "parsible-bench/parsible-bench.py",
+ "PYTHONPATH": ".."
+ },
+
+ "mersenne": {
+ "file": "mersenne/mersenne.py",
+ "PYTHONPATH": "..",
+ "args": ["3000"]
+ },
+
+ "richards": {
+ "file": "richards/richards.py",
+ "PYTHONPATH": "..",
+ "args": ["10000"]
+ },
+
+ "mandelbrot": {
+ "file": "mandelbrot/mandelbrot.py",
+ "PYTHONPATH": "..",
+ "args": ["128", "4096", "2048"]
+ },
+
+ "btree": {
+ "file": "btree/btree.py",
+ "PYTHONPATH": "..",
+ "args": ["32", "8000000"]
+ },
+
+ "skiplist": {
+ "file": "skiplist/skiplist.py",
+ "PYTHONPATH": "..",
+ "args": ["32", "6000000"]
+ },
+
+ "raytrace": {
+ "file": "raytrace/raytrace.py",
+ "PYTHONPATH": "..",
+ "args": ["4096", "4096"]
+ },
+
+ "perlin": {
+ "file": "perlin_noise/perlin_noise.py",
+ "PYTHONPATH": "..",
+ "args": ["5"]
+ }
+
+ }
+
+}
diff --git a/multithread/nqueens/nqueens.py b/multithread/nqueens/nqueens.py
--- a/multithread/nqueens/nqueens.py
+++ b/multithread/nqueens/nqueens.py
@@ -74,7 +74,7 @@
print "params (iters, threads, n):", warmiters, threads, n
print "do warmup:"
- for i in range(3):
+ for i in range(4):
t = run(threads, n)
print "iter", i, "time:", t
diff --git a/multithread/parsible-bench/parsible-bench.py
b/multithread/parsible-bench/parsible-bench.py
--- a/multithread/parsible-bench/parsible-bench.py
+++ b/multithread/parsible-bench/parsible-bench.py
@@ -35,7 +35,7 @@
print "params (iters, threads):", warmiters, threads
print "do warmup:"
- for i in range(4):
+ for i in range(6):
print "iter", i, "time:", run(threads)
print "turn off jitting"
diff --git a/multithread/perlin_noise/perlin_noise.py
b/multithread/perlin_noise/perlin_noise.py
--- a/multithread/perlin_noise/perlin_noise.py
+++ b/multithread/perlin_noise/perlin_noise.py
@@ -99,7 +99,9 @@
print "params (iters, threads, n):", warmiters, threads, n
print "do warmup:"
- for i in range(2):
+ # JIT compiles *tons* of bridges for the perlin_noise function
+ # turning it off after /some/ warmup speeds it up by 10x
+ for i in range(1):
t = time.time()
run(threads, n)
print "iter", i, "time:", time.time() - t
diff --git a/multithread/richards/richards.py b/multithread/richards/richards.py
--- a/multithread/richards/richards.py
+++ b/multithread/richards/richards.py
@@ -8,7 +8,10 @@
# Outer loop added by Alex Jacoby
import thread, os
-from common.abstract_threading import atomic, hint_commit_soon
+from common.abstract_threading import (
+ atomic, Future, set_thread_pool, ThreadPool,
+ hint_commit_soon, turn_jitting_off)
+
# Task IDs
I_IDLE = 1
@@ -442,7 +445,12 @@
print "params:", warmiters, threads, iterations
print "do warmup:"
- result, startTime, endTime = entry_point(4, threads)
+ entry_point(iterations, threads)
+ entry_point(iterations, threads)
+ entry_point(iterations, threads)
+
+ print "turn off jitting"
+ turn_jitting_off()
print "do", warmiters, "real iters:"
times = []
diff --git a/multithread/skiplist/skiplist.py b/multithread/skiplist/skiplist.py
--- a/multithread/skiplist/skiplist.py
+++ b/multithread/skiplist/skiplist.py
@@ -91,7 +91,7 @@
CONFLICTING = [SkipList.insert, SkipList.remove]
-OPS = [SkipList.find] * 198 + CONFLICTING
+OPS = [SkipList.find] * 1998 + CONFLICTING
ITEM_RANGE = 1000000
def task(id, slist, ops):
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit