예제 #1
0
파일: test_xor.py 프로젝트: cattaka/Xpra
def _test_functions(*fns):
    #1 frame of 4k 32bpp:
    size = 1024*1024*4
    s1 = get_source_data(size)
    s2 = get_source_data(size)
    for fn in fns:
        start = time.time()
        for _ in range(N):
            fn(s1, s2)
        end = time.time()
        elapsed = end-start
        print("%60s took %5ims: %5i MB/s" % (fn, elapsed*1000//N, size*N/1024/1024/elapsed))
예제 #2
0
def _test_functions(*fns):
    #1 frame of 4k 32bpp:
    pixels = 1024*1024*4
    d = get_source_data(pixels*4)
    for fn in fns:
        start = time.time()
        for _ in range(N):
            fn(d)
        end = time.time()
        elapsed = end-start
        print("%60s took %5ims: %5i MPixels/s" % (fn, elapsed*1000//N, pixels*N/1024/1024/elapsed))