Skip to content

Make the fast blob reader optional for clone-only consumers #7

Description

@andrew

Version 0.3.0 moved Blob and InspectBlob to an in-process go-git reader to speed up Scrutineer's repeated history reads. The change cuts the current blob benchmark from about 7.36 ms to 0.25 ms on an M1 Pro, so that fast path should remain available to Scrutineer.

The object-store implementation lives in the root clone package, which also means consumers using only Ensure or RedactURL compile the go-git storage packages. While updating Hyrum, changing only clone from v0.2.1 to v0.3.0 changed its module graph from 136 to 161 modules and its non-standard compile closure from 135 to 173 packages. The linked binary grew by about 106 KiB because the linker removed the unused blob-reading functions, but the build, go.sum, SBOM, and dependency-review surface still grew.

Steps to reproduce:

  1. Check out alpha-omega-security/hyrum.
  2. Run go list -m all and go list -deps -f '{{if not .Standard}}{{.ImportPath}}{{end}}' ./cmd/hyrum with clone v0.2.1.
  3. Run go get github.com/git-pkgs/clone@v0.3.0 && go mod tidy.
  4. Run the two listing commands again.

Could the fast reader move behind an opt-in package or module boundary, with Scrutineer importing that backend directly? The aim is to keep its current history-reading speed while letting clone/fetch-only consumers avoid the extra graph. A normal subpackage would reduce their compile closure, but a nested module would also keep go-git out of the root module graph.

Version: github.com/git-pkgs/clone v0.3.0.

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