Repository navigation
Bump go-runewidth to v0.0.30 for faster startup - #14577
Merged
Merged
Conversation
v0.0.27 eagerly built a 2.2MB width lookup table in init(), adding ~12ms to every gh invocation. v0.0.30 builds it lazily. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The valid dependency update is narrowly scoped and consistent with the documented upstream startup fix.
Review effort: Balanced
Findings: None
What changed in this PR
Bumps go-runewidth to restore faster GitHub CLI startup through lazy width-table initialization.
Changes:
- Updates the indirect dependency from v0.0.27 to v0.0.30.
- Refreshes corresponding module checksums.
| File | Description |
|---|---|
go.mod |
Updates the indirect dependency version. |
go.sum |
Records v0.0.30 checksums. |
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
williammartin
marked this pull request as ready for review
October 2, 2026 16:01
williammartin
requested review from
BagToad and
tidy-dev
and removed request for
tidy-dev
October 2, 2026 16:01
williammartin
enabled auto-merge
October 2, 2026 16:02
This was referenced Oct 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Every
ghinvocation pays for theinit()functions of every package linked into the binary, whether or not the command uses them.github.com/mattn/go-runewidth(an indirect dependency viacharm.land/bubbles/v2, used by the prompter) was bumped from v0.0.24 to v0.0.27 as part of #14249 (thecharm.land/bubbles/v22.1.1 → 2.2.0 bump). v0.0.27 eagerly fills a 2.2MB rune-width lookup table ([2][0x110000]byte) ininit(), which takes about 12ms. That was roughly a third of the total startup time ofgh --version.Upstream fixed this in v0.0.30 by building the table lazily on first lookup (mattn/go-runewidth#104), so importing the package is nearly free again. This PR bumps the indirect dependency to v0.0.30. No other modules change.
How did you test this change?
I built
bin/ghwithmakeon macOS (arm64) before and after the bump. I timed it withhyperfine -N --warmup 5 -r 60 './bin/gh --version', withGH_NO_UPDATE_NOTIFIER=1set:I also ran
GODEBUG=inittrace=1 ./bin/gh --versionto see the package's init cost directly:init github.com/mattn/go-runewidth ... 12 ms clock, 18776 bytes, 44 allocsinit github.com/mattn/go-runewidth ... 0.014 ms clock, 0 bytes, 0 allocsKey points
// indirect. It can't move backwards unless a direct dependency requires an older version.Notes for reviewers
go.modandgo.sum.strictWidthLUTinitialization mattn/go-runewidth#104 is the upstream issue that describes the eager-init cost and its fix.Authorship and follow-up
Who wrote this:
Who answers review comments: