From Fedora Project Wiki


lbzip2 as default bzip2 implementation

Summary

This change aims at making lbzip2 default implementation of bzip2 tool used in Fedora.

Owner

Current status

  • Targeted release: Fedora 21
  • Last updated: 2014-04-04
  • Tracker bug: <will be assigned by the Wrangler>

Detailed Description

lbzip2 is an independent implementation of bzip2 compression tool. It provides interface strictly compatible with bzip2, but also adds several new features and improvements, such as:

  • multi-threaded operation for both compression and decompression, with almost linear scalability,
  • improved performance, even on single-core systems,
  • improved extra utilities (bzdiff, bzless, bzip2recover, etc.),
  • improved compatibility with gzip.

lbzip2 is a mature project and it has been used in production for years. It is already packaged for Fedora and it is also available in EPEL.

lbzip2 is almost always the fastest compressor and decompressor. An example benchmark is awailable on devel mailing list. More benchmarks are available from upstream. Benchmarks prepared by independent parties can be found in the Internet.

lbzip2 also offers a feature which tries to balance compression time and resource usage while achieving the best compression ratio, which makes it a perfect choice for cloud as it minimizes bills for resource usage and data transfer.

The case of bzip2 and lbzip2 is an ideal candidate for usage of alternatives - both tools provide commands with compatible interfaces. This change proposes assigning higher priority to lbzip2 than to bzip2, which will effectively cause lbzip2 to be used instead of bzip2, if lbzip2 is installed. If for some reason some users don't like the change they can reconfigure alternatives manually and keep using bzip2.

This change does replace libbzip2 and it doesn't affect users of that library. bzip2 should not be confused with libbzip2. Upstream clearly distinguishes two of them on their web site and in documentation.

Benefit to Fedora

Making lbzip2 default bzip2 provider in Fedora will improve user experience. Compression and decompression of bz2 files will be faster and require less CPU power. The benefit will keep growing as with increasing number of processor cores in common hardware.

Unlike bzip2, lbzip2 is actively developed and maintained upstream, so switching to lbzip2 provides better chances of bugs being fixed and new features implemented.

Scope

  • Proposal owners:
    • make lbzip2 and bzip2 packages use alternatives for binaries and manpages they provide,
    • set higher priority for lbzip2 in alternatives,
    • identify packages which require bzip2 and port some of them to use lbzip2 instead.
  • Other developers:
    • test if their packages work with lbzip2,
    • possibly adjust spec files to require or build-require lbzip2 instead of bzip2.
  • Release engineering:
    • no action required.
  • Policies and guidelines:
    • no change required.

Upgrade/compatibility impact

No impact. lbzip2 upstream claims full compatibility with bzip2.

How To Test

  • Install Fedora.
  • Make sure that lbzip2 is used as default bzip2 implementation: running "bzip2 -V" should include text "lbzip2".
  • Find packages which require bzip2: "rpm -q --whatrequires bzip2".
  • Check if these packages work with lbzip2 (details vary depending on particular package).

User Experience

As noted above, this change will improve user experience by providing faster compression and decompression of bz2 files, as well as reduced CPU usage (power consumption).

No actions are required from users. Existing packages, scripts and third-party tools should keep working without changes.

Dependencies

None

Contingency Plan

  • Contingency mechanism: lower lbzip2 priority in alternatives so that bzip2 remains default implementation
  • Contingency deadline: release candidate
  • Blocks release? No
  • Blocks product? None

Documentation

lbzip2 provides manual pages for each command. No additional documentation should be needed.

Release Notes

TBA