penniger/zerobrew

A 5-20x faster experimental Homebrew alternative

★ 0Forks 0RustGitHub ↗Compare

README

zerobrew

English · 中文

Lint Test Release Discord License: MIT License: Apache 2.0

zerobrew demo

zerobrew brings uv-style architecture to Homebrew packages on macOS and Linux.

Install

curl -fsSL https://zerobrew.rs/install | bash

After install, run the export command it prints (or restart your terminal).

Or via Homebrew:

brew install lucasgelfond/zerobrew/zerobrew

Additional Installation Methods

From source

git clone https://github.com/lucasgelfond/zerobrew.git
cd zerobrew
cargo build --release
./target/release/zb install jq  # test it works

Pre-built binary

Download the latest release for your platform from the releases page and place the zb binary in your PATH.

npm (Node.js required)

npm install -g @lucasgelfond/zerobrew

Quick start

zb install jq                   # install one package
zb install wget git             # install multiple
zb bundle                       # install from Brewfile
zb bundle install -f myfile     # install from custom file
zb bundle dump                  # export installed packages to Brewfile
zb bundle dump -f out --force   # dump to custom file (overwrite)
zb uninstall jq                 # uninstall one package
zb reset                        # uninstall everything
zb gc                           # garbage collect unused store entries
zbx jq --version                # run without linking

Performance snapshot

Package Homebrew ZB (cold) ZB (warm) Cold Speedup Warm Speedup
Overall (top 100) 452s 226s 59s 2.0x 7.6x
ffmpeg 3034ms 3481ms 688ms 0.9x 4.4x
libsodium 2353ms 392ms 130ms 6.0x 18.1x
sqlite 2876ms 625ms 159ms 4.6x 18.1x
tesseract 18950ms 5536ms 643ms 3.4x 29.5x

Relationship with Homebrew

zerobrew is more of a performance-optimized client for the Homebrew ecosystem. We rely on:

  • Homebrew's formula definitions (homebrew-core)
  • Homebrew's pre-built bottles when available
  • Homebrew's package metadata and infrastructure

Our innovations focus on:

  • Content-addressable storage for deduplication
  • APFS clonefiles for zero-overhead copying
  • Source build fallback using Homebrew's Ruby DSL

zerobrew is experimental. We recommend running it alongside Homebrew rather than as a replacement, and do not recommend purging homebrew and replacing it with zerobrew unless you are absolutely sure about the implications of doing so.

Project status

  • Status: Experimental, but already useful for many common Homebrew formulas.
  • Feedback: If you hit incompatibilities, please open an issue or PR.
  • License: Dual-licensed under Apache 2.0 OR MIT, at your choice.

Contributing

PRs welcome!

Contributors

cachebagmaria-rckslucasgelfondabdalmoniempavvannaronchickrbutoipennigermcintsgramsobjectivecostavyrtihimudigondajvanderen1lbr77Xiao-ChenguangAfkaraLPquantumshirohanthorwe11adambrandonkalBBboy01eltociearordinary-hackershaanmajidtdjordanvyomakesh0728JasonYeYuhelittleKitchenfatelei

Issues