Skip to content

Improve JSON API for Install Performance Improvements #19204

Open
@Rylan12

Description

@Rylan12

Verification

Provide a detailed description of the proposed feature

The formula.json and cask.json files are downloaded almost every time an install or upgrade happens, and these files are large.

  • Shard the JSON files
    • Have a different file for each supported OS, so e.g. formula.arm64_sequoia.json and cask.arm64_sequoia.json
  • Create a new JSON API that contains the minimum information required to download a bottle's manifest file (name, version, hash)
    • Also move tap migrations and other similar config files to live here in a single JSON file
    • For casks, include a marker for whether the ruby file is needed or not
  • Store formula API information in the bottle manifest file
  • When installing a formula, use the new lightweight API and retrieve all missing information needed from the manifest
  • When installing a cask, use the new lightweight API to check whether a new version is needed, and then retrieve the remaining info from the cask's individual JSON file and/or the Ruby file
  • Create a new JSON API file to store formula/cask descriptions that’s downloaded on-demand for brew info or brew search --desc —-eval-all

What is the motivation for the feature?

To make installing formulae and casks via the API faster

How will the feature be relevant to at least 90% of Homebrew users?

Increased performance for all API installs

What alternatives to the feature have been considered?

  • Use a git repo with just the JSON files for each comparison (and since there are only 2 files it shouldn't have the issues we had with homebrew/core)
  • Using BSON and Webpack but they are (including when gzip compressed) larger than gzip compressed JSON

Metadata

Metadata

Assignees

No one assigned

    Labels

    featuresNew featureshelp wantedWe want help addressing this

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions