def test_performance_sequential(n, length): _str = random_string(length) _strarr = [_str for _ in range(n)] now = dt.now() [c.decompress(y) for y in [c.compressHC(x) for x in _strarr]] clz4_time = (dt.now() - now).total_seconds() now = dt.now() c.decompressarr(c.compressarrHC(_strarr)) clz4_time_p = (dt.now() - now).total_seconds() now = dt.now() [lz4.decompress(y) for y in [lz4.compressHC(x) for x in _strarr]] lz4_time = (dt.now() - now).total_seconds() print() print("LZ4 Test %sx len:%s" % (n, length)) print(" Cython LZ4 %s s" % clz4_time) print(" Cython LZ4 Parallel %s s" % clz4_time_p) print(" LZ4 %s s" % lz4_time)
def test_roundtripLZ4HCBack(): _str = "hello world" cstr = c.compressHC(_str) assert _str == lz4.decompress(cstr)
def test_roundtripHC(): _str = "hello world" cstr = c.compressHC(_str) assert _str == c.decompress(cstr)