Automattic / Automattic/harper

Reduce binary size

Open
#1,945 12 comments 2 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
15.4k
Forks
627
Avg merge
1d 15h
Merged PRs (30d)
102

Description

Currently, as of harper 0.64.0, the harper-ls-aarch64-unknown-linux-gnu binary on my machine weights 48M, which is a tad enormous for a command-line utility processing text. It's more than:
- a (minimal) [Linux distribution (alpine-virt)](https://www.alpinelinux.org/downloads/)
- the typst binary, which is doing parsing, processing, complex rendering pdf generation, … and their binary even embeds fonts!
- two times the size of the emacs binary

I know that "disk is cheap", but not everyone is using brand new hardware with terabytes of space, and even if it were the case, due to the rapid release schedule of harper, it ends up taking a significant amount of space on Linux distribution packages mirrors/archives.

The fact that the [release page](https://github.com/Automattic/harper/releases/tag/v0.64.0) shows that the .tar.gz archive weights only ~7M hints that the dictionaries aren't compressed, which would be a quick win.

Contributor guide

Open the contributing guide

Research direction

Start by inspecting the harper-ls release build and the dictionary assets, then compare the binary with the .tar.gz contents described in the issue. Determine whether dictionary compression reduces the shipped binary size; done means a materially smaller release binary without changing grammar-checking behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
build-system, cli, performance
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.