Esempio n. 1
0
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
Esempio n. 2
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
Esempio n. 3
0
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
Esempio n. 4
0
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))
Esempio n. 5
0
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))
Esempio n. 6
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