Commits

Carl Friedrich Bolz committed 72cbf44 Draft

also track memory

  • Participants
  • Parent commits a1ed406

Comments (0)

Files changed (2)

 
 
 executables = [
-    ("pypy-profile-overhead", "pypy-full", "--jit threshold=%s --jit function_threshold=%s" % (sys.maxint, sys.maxint)),
-    (None, "pypy-full", ""),
-    ("pypy-full2", "pypy-full", "--jit enable_opts=intbounds:rewrite:virtualize:string:pure:ffi"),
-    ("pypy-no-virtualize", "pypy-full", "--jit enable_opts=intbounds:rewrite:pure:ffi"),
-    (None, "pypy-c-no-objects", ""),
-    (None, "pypy-no-virtualizable-nobj", ""),
-    (None, "pypy-no-green-folding-nvirt-nobj", ""),
-    (None, "pypy-normal-tracing-noobj-novirt", ""),
-    (None, "pypy-no-jit", ""),
-    (None, "python", ""),
-    (None, "python2.6", ""),
-    ("psyco", "./psyco/python_with_psyco.sh", ""),
+    ("pypy-profile-overhead", "pypy-full", "--jit threshold=%s --jit function_threshold=%s" % (sys.maxint, sys.maxint), False),
+    (None, "pypy-full", "", True),
+    ("pypy-full2", "pypy-full", "--jit enable_opts=intbounds:rewrite:virtualize:string:pure:ffi", False),
+    ("pypy-no-virtualize", "pypy-full", "--jit enable_opts=intbounds:rewrite:pure:ffi", False),
+    (None, "pypy-c-no-objects", "", True),
+    (None, "pypy-no-virtualizable-nobj", "", True),
+    (None, "pypy-no-green-folding-nvirt-nobj", "", True),
+    (None, "pypy-normal-tracing-noobj-novirt", "", True),
+    (None, "pypy-no-jit", "", True),
+    (None, "python", "", True),
+    (None, "python2.6", "", False),
+    ("psyco", "./psyco/python_with_psyco.py", "", True),
     ]
 
+
 def main():
-    for name, exe, args in executables:
+    for name, exe, args, memory in executables:
         if name is None:
             name = exe
         print "running %s %s" % (exe, args)
             cmd += ' -a "%s"' % args
         print cmd
         os.system(cmd)
+        if memory:
+            assert not args
+            cmd = "%s runner.py -c %s --baseline=%s -o memory.%s.json --full-store -b %s --track_memory" % (exe, exe, exe, name, ",".join(b))
+            print cmd
+            os.system(cmd)
+
 
 if __name__ == '__main__':
     main()
 
 def run_and_store(benchmark_set, result_filename, changed_path, revision=0,
                   options='', branch='default', args='', upload=False,
-                  fast=False, baseline_path=sys.executable, full_store=False):
+                  fast=False, baseline_path=sys.executable, full_store=False,
+                  track_memory=False):
     funcs = perf.BENCH_FUNCS.copy()
     funcs.update(perf._FindAllBenchmarks(benchmarks.__dict__))
     opts = ['-b', ','.join(benchmark_set),
         opts += ['--args', args]
     if full_store:
         opts += ['--no_statistics']
+    if track_memory:
+        opts += ['--track_memory']
     opts += [baseline_path, changed_path]
     results = perf.main(opts, funcs)
     f = open(str(result_filename), "w")
     benchmark_group.add_option(
         "--full-store", default=False, action="store_true",
         help="Run the benchmarks with the --no-statistics flag.")
+    benchmark_group.add_option(
+        "--track_memory", default=False, action="store_true",
+        help="Run the benchmarks with the --track_memory flag.")
     parser.add_option_group(benchmark_group)
 
     # upload changed options
     fast = options.fast
     args = options.args
     full_store = options.full_store
+    track_memory = options.track_memory
     output_filename = options.output_filename
 
     branch = options.upload_branch
     results = run_and_store(benchmarks, output_filename, changed_path,
                             revision, args=args, fast=fast,
                             baseline_path=baseline_path,
-                            full_store=full_store, branch=branch)
+                            full_store=full_store,
+                            track_memory=track_memory,
+                            branch=branch)
 
     for run in [CHANGED, BASELINE]:
         upload = upload_options[run]['upload']