Skip to content

build: find and cut redundant weight in bin/codeaf (budget raised to 68.85 MB meanwhile) #1694

Open

Description

@AbirAbbas

Sub-issue of #1692. The budget is being raised to what the binary weighs today so make size passes again; this issue is the real fix: find what is redundant and take it out, then lower SIZE-BUDGET in the same commit.

Where the weight is (dev@2f33722b2, Go 1.26.5, make build flags)

platform stripped bin/codeaf, own furrow staged
darwin/amd64 67,497,584
linux/amd64 66,478,345
darwin/arm64 61,659,170
linux/arm64 60,358,818

On linux/amd64 the file is mostly .text (31.0 MB), .gopclntab (20.6 MB, grows with code) and .rodata (11.1 MB). (crypto/internal/fips140/drbg.memory shows as 33.5 MB in go tool nm, but it is in .noptrbss and takes no file space.) Largest file-backed contributors from go tool nm -size on an unstripped build:

  • internal/tui3 ~5.8 MB, internal/session ~3.7 MB, internal/store ~1.0 MB, internal/resident ~0.6 MB
  • modernc.org/sqlite ~1.8 MB
  • github.com/dop251/goja ~1.6 MB, which alone pulls in golang.org/x/text/collate and its ~1.3 MB of tables
  • the packed chat manual ~1.1 MB; the embedded furrow artifact (~3 MB gzipped per platform)

Growth: main@e44650715 weighed 57.9 MB on linux/amd64 on 2026-09-28; dev had reached 65.7 MB by 837b2b06a (2026-09-27) and 66.5 MB now.

Candidates to check

  • Is goja still needed, and if so can its Intl/collate dependency be avoided?
  • Dead code left behind by removed surfaces (tui2 compositor, search page, v1 bits), and duplicated helpers across tui3/session/resident.
  • Embedded assets that could be packed harder or fetched on first use.
  • Which commits between 2026-09-25 and 2026-09-27 added ~8 MB (bisect with make build and stat).

Acceptance

  • Each removal is weighed before and after on the heaviest platform (darwin/amd64) per PERF.md's size section, and SIZE-BUDGET is lowered in the same commit.
  • Because removals can break behaviour silently, each goes through make check and the tmux suite (make test-e2e-tui), not only the pull-request gate.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:buildmake targets, size budget, cross-build, releasehygieneTests, laws, dead code, duplication — no person-facing change

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions