←back to thread

457 points benoitg | 6 comments | | HN request time: 1.082s | source | bottom
Show context
b0a04gl ◴[] No.44365467[source]
every time your shell takes 100ms to render git status that you didn’t even need, you're paying invisible tax on flow. terminals should be reactive memory tools, not passive decoration. we optimize for code runtime but not for our own typing latency
replies(7): >>44365953 #>>44366256 #>>44366413 #>>44367231 #>>44367246 #>>44367362 #>>44367371 #
Twirrim ◴[] No.44365953[source]
Starship is very fast, taking only a couple of milliseconds to gather the data (and you can easily configure it to minimise what it'll spend time gathering). It's night and day compared to other ones I've tried, where the hundred millisecond-ish delays annoyed me.
replies(2): >>44366322 #>>44372064 #
1. Night_Thastus ◴[] No.44366322[source]
Depends a lot on the system. I tried using it on Windows via MSYS2, and it seems like some Windows overhead (maybe process startup?) was causing Starship to slow it all down to a crawl. Disabling a few of the addons helped but didn't fix it. In the end I stopped using it.
replies(2): >>44366809 #>>44370818 #
2. lukeschlather ◴[] No.44366809[source]
I don't know if Windows can be helped. It may be antivirus but I feel like 50th percentile load time is at least a second and there's nothing to be done about it. git just hangs sometimes on git show/git diff. I have to kill the terminal.
replies(1): >>44367297 #
3. WorldMaker ◴[] No.44367297[source]
My experience of Starship on Windows has been great. I'm using the Windows native builds of both Starship and git (both installed/updated via winget these days) in PowerShell.

I try to avoid emulation layers like MSYS2, as much as I'm able.

Also, yes, if git hangs on git show/git diff that sounds like an antivirus problem or a dying hard drive or the first one causing the other one.

replies(1): >>44367867 #
4. Twirrim ◴[] No.44367867{3}[source]
Or just a really big git repo. Starship includes a timings command, on linux (with an annoying antivirus meddling) this is what I see against one directory:

    git_status  -   6ms  -   "[!?] "
    directory   -   4ms  -   "<redacted> "
    python      -   3ms  -   "via  v3.12.9 (.venv) "
    character   -  <1ms  -   " "
    git_branch  -  <1ms  -   "on  main "
    hostname    -  <1ms  -   "<redacted> in "
If I go in to my checked out version of the linux kernel, probably the biggest git project I've got kicking around:

    git_status  -  115ms  -   ""
    directory   -    4ms  -   "linux "
    character   -   <1ms  -   " "
    git_branch  -   <1ms  -   "on  master "
    hostname    -   <1ms  -   "<redacted> in "
That's typically the worst I see it.
replies(1): >>44368963 #
5. WorldMaker ◴[] No.44368963{4}[source]
I appreciate Starship also has configurable limits on those timings, too. I've almost never seen Starship hang for very long, as it will just drop the thing that is slow. I sometimes but rarely (usually just starting a new shell, but sometimes if compiling in another window/terminal) see the "[WARN] Executing command git timed out" error and the git_status won't display until the next prompt and that is usually fine.
6. pxc ◴[] No.44370818[source]
Windows' filesystem performance for tools that expect Unix is abysmal, and it gets drastically worse in most corporate environments because endpoint security software hooks into the filesystem drivers to instrument all file access.

Git-aware prompts can't be recommended on Windows, imo.