facebook / sapling

A Scalable, User-Friendly Source Control System.
https://sapling-scm.com
GNU General Public License v2.0
5.93k stars 271 forks source link

`sl status` is too slow for shell prompts #708

Open ammario opened 11 months ago

ammario commented 11 months ago

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.

vegerot commented 10 months ago

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

ammario commented 10 months ago

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.