[pypy-svn] r59655 - pypy/build/benchmem

xoraxax at codespeak.net xoraxax at codespeak.net
Sun Nov 2 14:55:52 CET 2008


Author: xoraxax
Date: Sun Nov  2 14:55:50 2008
New Revision: 59655

Modified:
   pypy/build/benchmem/runbench.py
Log:
Compile appprofiles code before running, also add synchronization point.

Modified: pypy/build/benchmem/runbench.py
==============================================================================
--- pypy/build/benchmem/runbench.py	(original)
+++ pypy/build/benchmem/runbench.py	Sun Nov  2 14:55:50 2008
@@ -165,7 +165,7 @@
         benchpyfile = self.makebench(name)
         #self.log("created", benchpyfile)
         cmd = "%s -u %s" %(self.executable, benchpyfile)
-        self.log("running %s(%s)" %(name, self.options.numiter))
+        self.log("running %s(%s)" % (name, self.options.numiter))
         stdout, stdin = os.popen2(cmd)
         pid = int(stdin.readline())
         self.write_benchheader(name, self.options.numiter)
@@ -205,10 +205,15 @@
         #self.log("created", benchpyfile)
         cmd = "%s -u %s" %(self.executable, benchpyfile)
         self.log("running %s(%s)" %(name, self.options.numiter))
+        compile_cmd = 'from py_compile import compile; compile("%s")' % (str(benchpyfile), )
+        compile_cmdline = "%s -c '%s'" % (self.executable, compile_cmd)
+        os.system(compile_cmdline)
         stdout, stdin = os.popen2(cmd)
         pid = int(stdin.readline())
         self.write_benchheader(name, self.options.numiter)
         rec = smaps.SmapsRecorder(pid, self.logstream)
+        stdout.write("!")
+        stdout.flush()
         self.interact_with_child(rec, stdout, stdin)
 
     def makebench(self, name):
@@ -223,6 +228,7 @@
                 import os, sys, gc
                 pid = os.getpid()
                 write(str(pid) + "\\n")
+                sys.stdin.read(1)
                 %s %s
                 sys.stdin.close()
         """ %(name, arglist))



More information about the Pypy-commit mailing list