[pypy-svn] r47675 - pypy/dist/pypy/translator/goal
arigo at codespeak.net
arigo at codespeak.net
Sun Oct 21 18:00:06 CEST 2007
Author: arigo
Date: Sun Oct 21 18:00:06 2007
New Revision: 47675
Added:
pypy/dist/pypy/translator/goal/targetgcbench2.py (contents, props changed)
Modified:
pypy/dist/pypy/translator/goal/gcbench.py
Log:
A target similar to targetgcbench, but where the command-line arguments
give the depths of the trees to create.
Modified: pypy/dist/pypy/translator/goal/gcbench.py
==============================================================================
--- pypy/dist/pypy/translator/goal/gcbench.py (original)
+++ pypy/dist/pypy/translator/goal/gcbench.py Sun Oct 21 18:00:06 2007
@@ -107,7 +107,7 @@
t_finish = time.time()
println("\tBottom up constrution took %f ms" % ((t_finish-t_start)*1000.))
-def main():
+def main(depths=range(kMinTreeDepth, kMaxTreeDepth+1, 2)):
println("Garbage Collector Test")
println(" Stretching memory with a binary tree of depth %d" % kStretchTreeDepth)
print_diagnostics()
@@ -129,7 +129,7 @@
i += 1
print_diagnostics()
- for d in range(kMinTreeDepth, kMaxTreeDepth+1, 2):
+ for d in depths:
time_construction(d)
if long_lived_tree is None or array[1000] != 1.0/1000:
Added: pypy/dist/pypy/translator/goal/targetgcbench2.py
==============================================================================
--- (empty file)
+++ pypy/dist/pypy/translator/goal/targetgcbench2.py Sun Oct 21 18:00:06 2007
@@ -0,0 +1,24 @@
+import os, sys
+from pypy.translator.goal import gcbench
+
+def entry_point(argv):
+ if len(argv) > 1:
+ depths = [int(s) for s in argv[1:]]
+ gcbench.main(depths)
+ else:
+ gcbench.main()
+ return 0
+
+# _____ Define and setup target ___
+
+def target(*args):
+ return entry_point, None
+
+"""
+Why is this a stand-alone target?
+
+The above target specifies None as the argument types list.
+This is a case treated specially in the driver.py . If the list
+of input types is empty, it is meant to be a list of strings,
+actually implementing argv of the executable.
+"""
More information about the Pypy-commit
mailing list