Skip to content

borg2: Consider implementing multithreading for lz4 #10325

Description

@PhrozenByte

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions