facebook / sapling

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

sl is very slow in git repo #929

Open nicktogo opened 1 month ago

nicktogo commented 1 month ago

Hello, I know dotgit mode is still being developed. But sl command is very slow in my large mono git repo. Here is a truncated trace. It spends quite some time on a git status command.

If I run git status manually, it does spend quite some time on refreshing index, then sl command becomes fast again. But if I did some sl change, e.g. amend/commit, sl will be slow again on git status. I'm guessing it spends some time on refreshing index again.

I'm using latest release. Let me know what else info you need.

Glad that dotgit is being worked on, thank you so much!

➜   EDENSCM_LOG=debug sl status
...
2024-08-04T04:39:02.603878Z  INFO run:status: workingcopy::workingcopy: enter
2024-08-04T04:39:02.603903Z DEBUG run:status: workingcopy::filesystem::dotgit: pending_changes (DotGitFileSystem) include_ignored=false
2024-08-04T04:39:02.603920Z DEBUG run:status: gitcompat::rungit: git command: ["--git-dir=MY_REPO_PATH/.git", "--no-optional-locks", "status", "--porcelain=1", "--ignore-submodules=dirty", "--untracked-files=all", "--no-renames", "-z", "--ignored=no"]
2024-08-04T04:39:34.597473Z  INFO run:status:compute_status: workingcopy::status: enter
quark-zju commented 1 week ago

It's --no-optional-locks (added by https://github.com/facebook/sapling/commit/6b1912bd137ed2375fcefa1ec570802e855884ca). The difficult choice is:

Do you use the CLI or ISL? If you use the CLI we can change --no-optional-locks to automation (ISL) only. Then CLI status would probably be okay. If you use ISL exclusively then it's tricker to fix.

nicktogo commented 6 days ago

I mostly use ISL for commit, stacking, but I do use CLI sometimes, but basically just sl status/diff for some linters that we have.