[pypy-commit] stmgc default: add a benchmark walking trees that are global and read-only
fijal
noreply at buildbot.pypy.org
Mon Jul 8 10:28:38 CEST 2013
Author: Maciej Fijalkowski <fijall at gmail.com>
Branch:
Changeset: r369:5a8d2ec62277
Date: 2013-07-08 10:28 +0200
http://bitbucket.org/pypy/stmgc/changeset/5a8d2ec62277/
Log: add a benchmark walking trees that are global and read-only
diff --git a/duhton/demo/trees.duh b/duhton/demo/trees.duh
new file mode 100644
--- /dev/null
+++ b/duhton/demo/trees.duh
@@ -0,0 +1,17 @@
+
+(defun create-tree (n)
+ (if (< n 1) (list 1) (list (create-tree (/ n 2)) (create-tree (/ n 2))))
+)
+
+(defun walk-tree (tree)
+ (if (== (len tree) 1) (get tree 0)
+ (+ (walk-tree (get tree 0)) (walk-tree (get tree 1)))
+ )
+)
+
+(setq tree (create-tree 1024))
+(print (walk-tree tree))
+(setq n 0)
+(while (< n 1000)
+ (transaction walk-tree tree)
+ (setq n (+ n 1)))
More information about the pypy-commit
mailing list