-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
tree view is unusably slow on a large monorepo #8242
Comments
It looks like the repo is in some state that causes the underlying
Could you share what the git repo looks like when you started? e.g. is it stuck in rebasing? etc etc. |
I suffer from the same issue on a large monolith, with the same error in the log. This may or may not be helpful, but in my case 99% of the files are Python files. |
Nothing weird - the repo was in a clean state.
Oof - this is likely the problem. From my experience libgit2 is missing many performance features implemented in the git CLI which makes it unusable on our monorepo. I recently tried to use it in an internal CLI I was building. I built a command similar to I also found that some of the newer features of git aren't supported in libgit2 - which caused crashes in libgit2. |
This comment was marked as resolved.
This comment was marked as resolved.
$ cd company_repo
$ git ls-files | wc -l
311564
$ du -sh .
47G . $ cd kubernetes
$ git ls-files | wc -l
24149
$ du -sh .
1.3G . just to illustrate - our company's monorepo is over 10x larger than the k8 repo in terms of number of files, and many times larger in terms of disk weight. Another illustration of the weight difference: $ cd company_repo
$ time git status
0.70s user 0.06s system 97% cpu 0.777 total
$ time git status
0.67s user 0.05s system 96% cpu 0.755 total
$ cd kubernetes
$ time git status
0.02s user 0.04s system 74% cpu 0.086 total
$ time git status
0.02s user 0.03s system 61% cpu 0.089 total Note that this is with both folders in a clean, no changes, not rebasing, all pushed state after already having run |
There're plenty of issues regarding libgit2's performance being a couple
*magnitude* slower than git cli for most of the operations. One thing that
could potentially be a fix is to bump the libgit2 version (`0.14.2+1.5.1`
the former is libgit2 rs binding's version number, the latter is libgit2 c
code's version number), see if some fixes are shipped.
Brad Zacher ***@***.***> 于2024年2月25日周日 20:15写道:
… $ cd company_repo
$ git ls-files | wc -l
311564
$ du -sh .
47G .
$ cd kubernetes
$ git ls-files | wc -l
24149
$ du -sh .
1.3G .
@jianghoy <https://github.com/jianghoy> just to illustrate - our
company's monorepo is over 10x larger than the k8 repo in terms of number
of files, and many times larger in terms of disk weight.
Another illustration of the weight difference:
(Note that this is with both folders in a clean, no changes, not rebasing,
all pushed state.)
$ cd company_repo
$ time git status
0.70s user 0.06s system 97% cpu 0.777 total
$ time git status
0.67s user 0.05s system 96% cpu 0.755 total
$ cd kubernetes
$ time git status
0.02s user 0.04s system 74% cpu 0.086 total
$ time git status
0.02s user 0.03s system 61% cpu 0.089 total
—
Reply to this email directly, view it on GitHub
<#8242 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AIIWBJIMBKDT5Q3EGSENNEDYVPOZ3AVCNFSM6AAAAABDWCHVWCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNRTGE2TGNRTGY>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
OK created a feature branch that updated libgit2 to |
This can be more or less reproduced using chromium. The waits are not that large but noticeable. |
I was not running in to this issue running Zed Preview that I had used for quite a while. I've just had to wipe my mac and reinstall Zed Preview (using the same version as before the wipe) and have now run in to the issue. EDIT: As mentioned above, it looks like libgit2 is the issue. I found this issue on the git-branchless repo which is essentially what we're running in to here. I tried what is mentioned in this comment and it worked perfectly for me (downgrading to git 2.39.3), no more performance issues. Libgit2 has supposdely fixed this issue in version 1.7.3 or later. I'm unsure on how to check what version Zed uses. |
@Liam-Breen We're using 1.5.1:
We may have to wait until 1.8.0 is out: rust-lang/git2-rs#1032 |
Dropping in to say also seeing this on a larger monorepo (React, Next.js, etc.) Try to navigate a few levels deep and the folder will switch to open, nothing happens, the CPU usage spikes in Activity Monitor (MacOS), and after maybe 30 seconds or so, the files show up. All directories at that level will then open quickly until you want to go a level deeper and then it's the same thing again. It takes some time for the CPU usage to drop below 95% after this 😢 |
There have been some recent improvements made to the project view by @osiewicz in the #12980, perhaps it will help. 👍 BTW, a new version of the Also, a few other potentially related improvements from @maxbrunsfeld (including replacing some |
Will update and keep my fingers crossed 🤞 fwiw - love using it for my other projects where it handles it all fine 🤙 |
Related to: #8242 Release Notes: - N/A
Related to: zed-industries#8242 Release Notes: - N/A
I can reproduce the stalls when opening an artificial project with 100k files in it. Notably this project doesn't have .git folder, which means that we're not necessarily bound by git perf (though historically it has been a bit of an issue for us). I will try to push forward another fix which should help with that 100k repro I'm seeing. The project itself can be created with:
|
On a general note about the project panel slowliness (after implementing my own way with the outline panel tree): almost every operation in project tree goes through clears its entries zed/crates/project_panel/src/project_panel.rs Line 1547 in bb1d52b
and goes through every entry of every worktree to repopulate (and sort) things, zed/crates/project_panel/src/project_panel.rs Line 1579 in bb1d52b
all on the main thread, it seems, and without any kind of back-off or cancellations in case of the event flood. Also, this happens on every active project entry changed, even if the panel is not focused. zed/crates/project_panel/src/project_panel.rs Lines 192 to 196 in bb1d52b
"almost every operation " is
I would say that this approach is incompatible with large workspaces. |
Some great info and digging @SomeoneToIgnore @osiewicz 👏 Thanks! |
You're welcome @jh3y - did the recent changes improve the situation anyhow for you? |
Massively! Jus' tried it out 🙌 I can now use it for everything 🤞 Very happy with that because I've been really enjoying its speed and aesthetic 😍 |
@bradzacher @jbkkd When you get a chance, could you check if things are faster in the latest Zed Preview v0.140.0 or later? Now, when opening Zed in a huge repo like |
I work with a very large repo and performance has definitely improved for me @maxbrunsfeld |
For those of you who experienced this issue, do things feel good enough for us to close this issue out? |
Tried again now on our huge repo (same one @Liam-Breen works on) and Zed is usable. Thanks! |
Unfortunately, Zed is still very slow to start in my case. I am working on a repo similar to this one, but like 10x larger. The main thing is that all TOML and JSON files in the The structure of the repo is not very friendly to git, to say the least. Nevertheless, VSCode starts pretty quickly, and as far as I understand this is achieved by not running Also, not directly related to this issue, but it is very helpful that in VSCode in
and the Python language server becomes responsive relatively quickly. |
Check for existing issues
Describe the bug / provide steps to reproduce it
Screen.Recording.2024-02-23.at.14.16.31.mov
Sorry about the blurring - internal company monorepo so can't really share the names out.
When opening zed it takes around 20s for zed to show the 1st-level contents of the folder.
Problem number one here is that there is no progress bar or activity indicator to show that something is happening.
The first time I added the folder to the IDE I thought I'd done something wrong because nothing showed up. I switched away to read the docs and when I went back to zed it showed the folders.
I then try to expand a folder. The folder I clicked on has JUST ONE file in it. The video cuts off before the folder contents show up - I let it go for about a minute before I got bored and stopped recording so I don't know how long it took overall (I trimmed the video down).
Sadly this makes the IDE unusable as a daily driver for me.
Environment
Zed: v0.123.3 (Zed)
OS: macOS 14.3.1
Memory: 64 GiB
Architecture: aarch64
If applicable, add mockups / screenshots to help explain present your vision of the feature
No response
If applicable, attach your
~/Library/Logs/Zed/Zed.log
file to this issue.If you only need the most recent lines, you can run the
zed: open log
command palette action to see the last 1000.The last 7000 lines of the log are just this repeated:
The text was updated successfully, but these errors were encountered: