Exemple #1
0
def pystones_main(loops):
    benchtime, stones = rpystone.pystones(abs(loops))
    s = '' # annotator happiness
    if loops >= 0:
        s = ("RPystone(%s) time for %d passes = %f" %
             (VERSION, loops, benchtime) + '\n' + (
             "This machine benchmarks at %f pystones/second\n" % stones))
    os.write(1, s)
    if loops == 12345:
        pystones_main(loops-1)
Exemple #2
0
def pystones_main(loops):
    benchtime, stones = rpystone.pystones(abs(loops))
    s = ''  # annotator happiness
    if loops >= 0:
        s = ("RPystone(%s) time for %d passes = %f" %
             (VERSION, loops, benchtime) + '\n' +
             ("This machine benchmarks at %f pystones/second\n" % stones))
    os.write(1, s)
    if loops == 12345:
        pystones_main(loops - 1)
Exemple #3
0
 def run(c_entry_point):
     res = c_entry_point(LOOPS)
     (benchtime, stones), _ = res
     print "translated rpystone.pystones time for %d passes = %g" % (LOOPS, benchtime)
     print "This machine benchmarks at %g translated rpystone pystones/second" % (stones,)
     res = c_entry_point(50000)
     _, g_addr = res
     print "CPython:"
     benchtime, stones = rpystone.pystones(50000)
     print "rpystone.pystones time for %d passes = %g" % (50000, benchtime)
     print "This machine benchmarks at %g rpystone pystones/second" % (stones,)
Exemple #4
0
 def run(c_entry_point):
     res = c_entry_point(LOOPS)
     (benchtime, stones), _ = res
     print "translated rpystone.pystones time for %d passes = %g" % \
           (LOOPS, benchtime)
     print "This machine benchmarks at %g translated rpystone pystones/second" % (stones,)
     res = c_entry_point(50000)
     _, g_addr = res
     print "CPython:"
     benchtime, stones = rpystone.pystones(50000)
     print "rpystone.pystones time for %d passes = %g" % \
           (50000, benchtime)
     print "This machine benchmarks at %g rpystone pystones/second" % (stones,)
Exemple #5
0
 def entry_point(loops):
     g = rpystone.g
     g.IntGlob = 0
     g.BoolGlob = 0
     g.Char1Glob = '\0'
     g.Char2Glob = '\0'
     for i in range(51):
         g.Array1Glob[i] = 0
     for i in range(51):
         for j in range(51):
             g.Array2Glob[i][j] = 0
     g.PtrGlb = None
     g.PtrGlbNext = None
     return rpystone.pystones(loops), current_object_addr_as_int(g)
Exemple #6
0
 def entry_point(loops):
     g = rpystone.g
     g.IntGlob = 0
     g.BoolGlob = 0
     g.Char1Glob = "\0"
     g.Char2Glob = "\0"
     for i in range(51):
         g.Array1Glob[i] = 0
     for i in range(51):
         for j in range(51):
             g.Array2Glob[i][j] = 0
     g.PtrGlb = None
     g.PtrGlbNext = None
     return rpystone.pystones(loops), current_object_addr_as_int(g)