sapling icon indicating copy to clipboard operation
sapling copied to clipboard

`sl status` is too slow for shell prompts

Open ammario opened this issue 2 years ago • 2 comments

I'm trying to use sl status in my shell prompt, but the command consistently takes 400ms whereas git status in the same repo takes 70ms.

I'm running it on coder/coder and my fish prompt source is here.

ammario avatar Aug 19 '23 23:08 ammario

agreed. It's better just to read the .sl/ directory directly. This is what we do in our zsh and bash prompt

I'm not familiar with fish, but hopefully you can use scm-prompt.sh as inspiration for your fish prompt.

Not to detract from your point that sl status is slow. We should make it faster.

Note: without eden, git status might be faster than sl status, but note that fast git prompts also avoid calling git. They do similar techniques as Sapling's suggested prompt

vegerot avatar Aug 26 '23 00:08 vegerot

Thanks for sharing.

Unfortunately it seems like you still need sl status to get the dirty state (which is very important to me), so the .sl/ tricks only shaves ~100ms (30%) off.

ammario avatar Aug 26 '23 22:08 ammario