-
Notifications
You must be signed in to change notification settings - Fork 285
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Actions become substantially slower over time #936
Comments
I'm not sure about
which appeared to clean some things up? |
Had same issue when upgrading to the latest version a while ago. I re-cloned with SL and it's working fine until recently, it's slower again. |
Is your repo a If it's
|
Mine is a I've attached the debug logs for
|
That would be a Could you try the |
Ah sorry, the output is
I do not have watchman installed |
Thanks. It looks normal. Something might have regressed without our notice (non-watchman, non-edenfs use-cases are rare in production). I can have a look when I get time. |
@ianb-pomelo What is the version of Sapling you're using? Are you building
? |
I installed Sapling via Homebrew and am using version Sapling 0.2.20240718-145624-f4e9df48 I tried that command and it was about the same performance as without that config. I have also tried installing watchman and that substantially sped things up so for me I can just use that setup |
I'm using
setting the flag to
|
@quark-zju do you have some suggestions how to work around this, other than re-cloning? |
I have encountered this, too. A quick run under Instruments showed that in my case the issue was due to multi-pack index validation. The issue only appears after some time because originally there is no multi-pack index, as the count of pack files is low. This also means I could fix it temporarily by running git's garbage collection on the The reason it's slow seems to be due to excessive validations on multi-pack index loading as described in libgit2/libgit2#6166 which is fixed in the upstream. Indeed, simply recompiling sapling with the |
Thanks for sharing! @destroycomputers this works for me too!! |
As a temporary solution, you can try disabling multi-pack index by appending to
Then delete the multi-pack index file:
The underlying complexity is with It seems the multi-pack index is causing multiple issues - performance issues reported here, and "object not found" issues reported internally ("not found" by libgit2, but found by |
@quark-zju meanwhile, would it be possible to bump the version of the |
Good catch. I didn't realize we're using an old version. I tried upgrading it but it does not seem as trivial since other 3rd party dependencies in the monorepo (like cargo, sqlite, etc) wants the older version. Upgrading them could be a choice but if it's too hard we might try different approaches. UPDATE: It is more complex than I thought. Let's say it's not feasible to upgrade now. Our plan might be migrating off libgit2. |
Just as a data point, I've ran into this pretty consistently with a large git repo that I've been working in where I get object not found errors after a |
Hi @quark-zju, I'm running into the same issues where I get "object not found" after a while. Disabling incremental repack fixes it, but now I'm running into performance issues. I see that sapling is on |
Hi @johnpanos. Thanks for the update. The complexity of upgrading is mainly because the libgit2 is also used in other projects internally in a monorepo (and shared across languages, esp. C++). Upgrading it only for Sapling but not breaking builds for other projects is tricky. It seems it's more feasible to just migrate to using git commands (ex. By the way, are you using |
@quark-zju is it possible in your build system to compile the dependency statically? Given their ( FWIW, the public distribution of sapling that can be found in the Releases of this repository does vendor libgit2 and isn't dependent on it dynamically. |
Thanks for the quick reply @quark-zju! I also appreciate you letting me know about the monorepo setup, I see how that can be almost insurmountable. I'm using |
Internally we use buck2 to build. The cargo.toml files are generated from buck2 definitions. The problem is that the buck2 definition of libgit2 is shared across languages and projects in the monorepo. So if you want to update it (regardless of using static or dynamic linking) by default it potentially break other Rust/C++/Python projects in the monorepo that directly/indirectly share the same libgit2 buck2 definition. While it might be possible to "fork" related projects for sapling's use-case, it's usually a last resort, not considered as a good practice, and in this case you'd fork C++ libgit2, Rust git2, configure them for all platforms (windows, linux, macos-arm, macos-intel) in the buck2 way, which is non-trivial as well.
You can read some docs at https://sapling-scm.com/docs/dev/internals/indexedlog and https://sapling-scm.com/docs/dev/internals/zstdelta. The indexedlog crate was published as sapling-indexedlog. We can publish the zstdelta and zstore crate too if you're interested. The zstore is already used for tracking the metadata (i.e. references), if you want to (roughly) compare it with git you can look at the |
@quark-zju fair enough, thanks for the reply. |
@quark-zju IndexedLog is fascinating. I'm definitely going to do a deep dive on this after my $DAYJOB. I definitely have a lot of questions I'd like to ask, but I don't believe this is the appropriate forum for them. Is there a more appropriate community discord/slack that I can ask those in instead? |
There is a Discord link at the bottom of https://sapling-scm.com/ |
I have a checkout of a git repo in sapling that I have been using for a while and as I've used it more and more, the commands (such as
sl status
andsl
) have been substantially slower. I checked out a new version of the repo with Sapling andsl
is almost 2x slower in my older checkout andsl status
is ~8x slower. I suspect that it has something to do with all the history that I have locally that is hidden. Is there a way to clean up the checkout a bit to remove these stale references that I don't want to bring back? Or do I just have to routinely checkout new copies?The text was updated successfully, but these errors were encountered: