def test_richards(): from pypy.translator.goal.richards import entry_point entry_point = compile_function(entry_point, [int]) result, start, end = entry_point(1000) assert result assert end - start > 0 and end - start < 15.0
def test_rpystone(): from pypy.translator.test.rpystone import pystones as entry_point entry_point = compile_function(entry_point, [int]) t, pystones = entry_point(50000) assert 0 < t < 5 assert 100000 < pystones < 100000000
def richards_main(iterations): s = "Richards benchmark (RPython) starting...\n" os.write(1, s) result, startTime, endTime = richards.entry_point(iterations) if not result: os.write(2, "Incorrect results!\n") return os.write(1, "finished.\n") total_s = endTime - startTime avg = total_s * 1000 / iterations os.write(1, "Total time for %d iterations: %f secs\n" %(iterations, total_s)) os.write(1, "Average time per iteration: %f ms\n" %(avg))
def richards_main(iterations): s = "Richards benchmark (RPython) starting...\n" os.write(1, s) result, startTime, endTime = richards.entry_point(iterations) if not result: os.write(2, "Incorrect results!\n") return os.write(1, "finished.\n") total_s = endTime - startTime avg = total_s * 1000 / iterations os.write(1, "Total time for %d iterations: %f secs\n" % (iterations, total_s)) os.write(1, "Average time per iteration: %f ms\n" % (avg))