Пример #1
0
def compress_array(str_list):
    """
    Compress an array of strings

    By default LZ4 mode is standard in interactive mode,
    and high compresion in applications/scripts
    """
    if not ENABLE_PARALLEL:
        return [lz4.compress(s) for s in str_list]

    # Less than 50 chunks its quicker to compress sequentially..
    if len(str_list) > LZ4_N_PARALLEL:
        return clz4.compressarr(str_list)
    else:
        return [clz4.compress(s) for s in str_list]
Пример #2
0
def compress_array(str_list):
    """
    Compress an array of strings

    By default LZ4 mode is standard in interactive mode,
    and high compresion in applications/scripts
    """
    if not ENABLE_PARALLEL:
        return [lz4.compress(s) for s in str_list]

    # Less than 50 chunks its quicker to compress sequentially..
    if len(str_list) > LZ4_N_PARALLEL:
        return clz4.compressarr(str_list)
    else:
        return [clz4.compress(s) for s in str_list]