#7712·starship

Git prompt perf regression for smaller repo's

Author: brandondongCreated Aug 31, 2026Updated Sep 4, 2026
Labels🐛 bug

Current Behavior

After upgrading from 1.17.1 -> 1.26.0 (yes, I hadn't upgraded in a long time), there was a noticeable slowdown in the git prompt speed for small repos. In my prompt, I'm only including git_branch/git_commit/git_state/git_status.

Before, zipping around smaller repo's felt basically instant. Now it takes ~150ms for the prompt to render which is slow enough for my eyes to catch and be grating.

Expected Behavior

For the prompt in smaller repo's, it should be no slower than manually running git status.

Additional context/Screenshots

I manually added instant.elapsed() calls around the code and found that of the ~150ms, most was not actually spent performing git status. Rather, ~100ms was taken for this singular line: https://github.com/starship/starship/blob/cc763c5557a235530ff00c8917169bb77aac1e24/src/context/mod.rs#L369

If I shrink my prompt just to git_branch, this ~100ms now takes up basically all the time.

If I do a targeted revert of https://github.com/starship/starship/commit/daf8d93d27fdc70b110a4a56799d7dc3a10c3810#diff-d6346fd7d17270b1282142aeeda9c4bc2b7d8fd0f37b24a1c871a9257f0ed0aa Specifically, only these 4 lines: Then, that ~100ms turns to single digit milliseconds!

Possible Solution

I'm not familiar enough with the code to know why it's necessary for correctness to have that change. Given the context of the PR that introduced it, maybe those fields could be set back to false if use_git_executable is true and git_metrics is not enabled?

@Byron would love to get your insight :)

Environment

  • Starship version: 1.26.0
  • nu version: 0.114.1
  • Operating system: Windows 10.0.19045
  • Terminal emulator:
  • Git Commit Hash: fca92d8
  • Branch/Tag: main
  • Rust Version: rustc 1.96.0 (ac68faa20 2026-05-25)
  • Rust channel: stable-x86_64-pc-windows-msvc release
  • Build Time: 2026-06-28 17:05:55 +00:00

Relevant Shell Configuration

$env.config.show_banner = false
$env.config.buffer_editor = "micro"

alias lg = lazygit

mkdir ($nu.data-dir | path join "vendor/autoload")
source ~/.zoxide.nu

Starship Configuration

# Default format ($all) with all languages disabled and only a minimal set of tools left.
format = """
$username\
$hostname\
$directory\
$git_branch\
$git_commit\
$git_state\
$git_status\
$line_break\
$character"""

[directory]
use_os_path_sep = false
truncate_to_repo = false
truncation_length = 0

[git_branch]
symbol = ''

[git_status]
# Default format with $all_status expanded, $stashed removed, and some rearranging.
format = '([($conflicted )(\[$staged$deleted$renamed$modified$untracked\])(\[$ahead_behind\])]($style))'
conflicted = 'CONFLICT'

[character]
success_symbol = '[>](bold green)'
error_symbol = '[>](bold red)'