Skip to content

Improve gh start-up time #9724

Open
Open

Description

@BagToad

Context

In #9686, it was reported that gh start-up time could be improved.

In #9686 (comment), it was discovered that a factor causing slow gh start-up time is related to tcell's init process, and that setting TCELL_MINIMIZE=1 to bypass that process could improve gh start-up time.

This issue is to investigate and identify any other factors involved in a less than optimal gh start-up time and provide a recommendation of what can be done to improve the situation

Expected output

  • An investigation into factors slowing down gh start-up time
  • A recommendation on the work required to reduce gh start-up time

Activity

  1. added
    gh-completionrelating to the gh completion command
    tech-debtA chore that addresses technical debt
    and removed on Oct 7, 2024
  2. williammartin commented on Oct 7, 2024

    @williammartin
    Member

    Before I forget, the existing attempt to set TCELL_MINIMIZE is just not going to consistently work:

    // Signal the tcell library to skip its expensive `init` block. This saves 30-40ms in startup
    // time for the gh process. The downside is that some Unicode glyphs from user-generated
    // content might cause misalignment in tcell-enabled views.
    //
    // https://github.com/gdamore/tcell/commit/2f889d79bd61b1fd2f43372529975a65b792a7ae
    _ = os.Setenv("TCELL_MINIMIZE", "1")
    }

    The issue is that init functions are executed deepest first, with different import branches having no guarantees between them. Thus, the only way to have tcell init run after our init would be to have a direct dependency on our init from tcell i.e. forking it. At least that's the only way I can think of it working.

  3. self-assigned this
    on Dec 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

gh-completionrelating to the gh completion commandneeds-investigationCLI team needs to investigatetech-debtA chore that addresses technical debt

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions