Following my compression benchmark results in #10315 (comment), we discussed whether lz4 could be made multi-threaded in Borg, similar to how zstd already is.
LZ4 does support multithreading (reported by Phoronix and as implemented for the CLI in lz4/lz4#1336), but this functionality seems to be limited to the CLI tool right now. Unlike zstd, there is no simple threads= option available for library integration, which makes implementation more challenging.
The LZ4 project lists https://pypi.org/project/py-lz4framed/ as a "multi-threadable" Python binding. However, "multi-threadable" in this context means the implementation is thread-safe, not that it provides built-in multithreading. Any parallelization would need to be implemented manually in Borg.
It might be worth investigating:
- Whether Borg currently uses the block-based compression format or the newer frame-based compression format, and what implications a potential switch to the frame-based format would have, given that it appears as if only the latter can be implemented thread-safe
- Whether Borg could leverage LZ4's multithreading support
- Which implementation approach would be most practical
- How the performance would compare to the current
zstd multithreaded results, in particular in comparison to zstd,-4
Related: #10161
Following my compression benchmark results in #10315 (comment), we discussed whether
lz4could be made multi-threaded in Borg, similar to howzstdalready is.LZ4 does support multithreading (reported by Phoronix and as implemented for the CLI in lz4/lz4#1336), but this functionality seems to be limited to the CLI tool right now. Unlike
zstd, there is no simplethreads=option available for library integration, which makes implementation more challenging.The LZ4 project lists https://pypi.org/project/py-lz4framed/ as a "multi-threadable" Python binding. However, "multi-threadable" in this context means the implementation is thread-safe, not that it provides built-in multithreading. Any parallelization would need to be implemented manually in Borg.
It might be worth investigating:
zstdmultithreaded results, in particular in comparison tozstd,-4Related: #10161