8000 Audit the codebase for release binary size reductions · Issue #772 · project-minigraf/minigraf · GitHub
[go: up one dir, main page]

Skip to content

Audit the codebase for release binary size reductions #772

Closed
4 of 4 issues completed
Closed

Description

@adityamukho

PR #771 (#530) needed a size-focused design review to stay within the existing release binary budget. Reusing existing tree primitives, removing an unnecessary generic walker/encoder helper, and avoiding another general sort specialization reduced the measured binary from 1,263,848 to 1,258,784 bytes. The unchanged cap is 1,259,520 bytes, leaving only 736 bytes of headroom.

Extend that review across the entire codebase for v3.0.0. Look for avoidable monomorphization and duplicated specializations, redundant helpers or algorithms, opportunities to reuse existing primitives, and other changes that reduce shipped code without adding complexity. Include the library/CLI and feature-specific native, browser and WASI paths.

  • Establish reproducible size baselines with compiler, profile, features and target recorded.
  • Inspect symbol/section contributions and their call sites throughout the codebase.
  • Produce a ranked inventory of opportunities, with measured before/after byte savings from focused prototypes and the runtime, memory and maintenance tradeoffs.
  • File and link small, independently reviewable follow-up changes for worthwhile opportunities; explain rejected candidates where size savings would compromise reliability or performance.
  • Preserve public API, file format, error behaviour, portability and MSRV. Keep the current size cap and coverage floors unchanged; run heavy verification and performance comparisons on the bench machine.

The goal is more release-size headroom while retaining Minigraf's embedded, self-contained, reliability-first design. Use PR #771 and its size/coverage follow-up as the concrete starting example.

Activity

  1. added this to the v3.0.0 milestone on Oct 27, 2026
  2. adityamukho commented on Oct 29, 2026

    @adityamukho
    CollaboratorAuthor

    Audit report and reproducible evidence are ready for review in #798 (draft, based on v3 3d19abbce).

    The baseline CLI is 1,263,592 bytes, just 24 bytes below the current 1,263,616-byte cap. Seven independent source probes, native/library/browser/WASI baselines, packaged-browser measurements, and bench performance comparisons are recorded.

    Linked follow-ups:

    The report explicitly rejects the slower free-page sort, a size-increasing set comparison sort, and the zero-saving Chrono feature change. No production code or cap/coverage threshold has changed. Verification boundaries, including the tmpfs baseline suite and completed disk-backed set integration checks, are documented in the PR.

    Leaving #772 open for review/merge of the audit report; the implementation work is separated into the follow-ups above.

  3. added a commit that references this issue on Oct 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestperformanceBenchmark performance regressions

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0