-
Notifications
You must be signed in to change notification settings - Fork 326
Open
Description
Problem description
sl status is very slow after sl amend on large repositories. But following sl status is relatively fast. So this looks like sl amend breaks git index, so git status has to rebuild it.
Repro
Clone big repo using git. I used linux:
$ git clone https://github.com/torvalds/linux
$ cd linux
Create test commit:
$ touch test.txt
$ sl add test.txt
$ sl commit -m test
Test amend with git
$ time git commit --amend -m 'test' && time git status
[detached HEAD 7047645cf307] test
Date: Mon Aug 18 05:06:51 2025 +0100
14 files changed, 807 insertions(+), 402 deletions(-)
create mode 100644 test.txt
zsh: time git commit --amend -m 'test': 0.43s real 0.05s user 2.43s system
HEAD detached from c17b750b3ad9
nothing to commit, working tree clean
zsh: time git st: 0.42s real 0.07s user 1.43s system
0.4s for amend and then 0.4s for st. It is fast.
Now do the same with Sapling
$ time sl amend && time sl st
7047645cf307 -> 0d2b4fcf6696 "test"
zsh: time sl amend: 2.69s real 0.34s user 2.46s system
zsh: time sl st: 14.34s real 2.53s user 5.04s system
2s for amend (tolerable), but then 14s for st, which is way too slow.
While sl st is executed, this git process is shown in ps:
$ ps aux | grep git
st 52628 39.7 0.1 412806592 29456 s003 U+ 5:06a.m. 0:02.66 git --git-dir=/Users/st/devel/left/linux/.git status --porcelain=1 --ignore-submodules=dirty --untracked-files=all --no-renames -z --ignored=no
Following sl st is reasonably fast:
$ time sl st
zsh: time sl st: 0.52s real 0.09s user 1.21s system
It is the same if we use sl amen && git status instead of sl status:
$ time sl amend && time git status
0d2b4fcf6696 -> 16e61b7a157d "test"
zsh: time sl amend: 3.32s real 0.34s user 2.57s system
Refresh index: 100% (90498/90498), done.
HEAD detached from c17b750b3ad9
nothing to commit, working tree clean
zsh: time git status: 14.88s real 2.55s user 5.17s system
Note "Refresh index", which happens after sl amend, but not after git commit --amend.
Which suggests that sl amend corrupted some git index, first git status had to rebuild it.
Versions
sl --version
Sapling 0.2.20250521-115337-25ed6ac4
git --version
git version 2.50.1
uname -a
Darwin LUS-C6RQKMR2VG 24.6.0 Darwin Kernel Version 24.6.0: Mon Jul 14 11:30:40 PDT 2025; root:xnu-11417.140.69~1/RELEASE_ARM64_T6041 arm64
Metadata
Metadata
Assignees
Labels
No labels