-
Notifications
You must be signed in to change notification settings - Fork 588
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
Performance regression when creating pull requests on a repo with lots of branches #4814
Comments
We should be immediately populating the "merge into" with |
Good question, I'll let you know the next time I create a PR. |
OK, I ran into this again; the answer is "alphanumerically sorted, the first branch in the repo." In other words, I see, in order, the following:
|
Thanks @janakjjp for the additional details. I found a case where we're listing branches way too many times. I'm making a fix for it and I'll let you know when it's available in the pre-release build of the extension. |
@janakjjp, the new pre-release build is available and can be used with VS Code insiders. I fixed an issue with listing branches in the create pr view, but since you're the only one who reported this particular issue it would be very helpful if you could try out the new pre-release build and comment about whether this issue is fixed! |
I tested this, and unfortunately I am still seeing a CPU spike in loading the PR create dialog. Looks like there's probably another callsite? Now that I have the insiders build, let me know if I can do any other debugging for you to help with this. |
A little more debugging detail:
So, if I had to guess, it seems there are three expensive calls, and one of them was fixed! |
@janakjjp thanks for the details! I'll have another look since that first 45 seconds shouldn't be happening. For the last expensive call: We're going to have to fetch branches at some point to fully populate the dropdown. I'll make sure we don't have extra calls in there, but at best I can do the following:
|
Hmmm, I'm torn about having to fully populate the dropdown, as opposed to trimming it after X branches. Part of the challenge is that GH (I think) uses a type-to-complete mechanism and so can lazily fetch. I don't want to make your life too difficult here, I know we're an edge case, so any optimizations are welcome but I understand you can't always solve for the extreme case. |
I found some more places where we're making extra GitHub API calls. The change will be in the pre-release build on Monday. @janakjjp I'd be very interested to hear if you find that the build on Monday has better performance! I have not yet added any caching, but I can consider it if you're still seeing serious slowness. |
Just updated my VSCode Insider's with the latest GH extension and it appears that the performance is very similar. Both the nightly and the stable release took 2m30s for the dialog to load. (It seems the dialog was more immediately responsive on the new plugin, but I didn't test that part extensively.) |
Thanks @janakjjp for trying it out and reporting back! At this point, given that I can't reproduce the slowness and that I've exhausted the perf gains to be had by removing unneeded calls, I think we have to look at caching next. We're currently reworking the Create PR view. Maybe you'll see some gains as we transition to the new view. I'll also be hyper aware of perf in the new view. Reopening to consider adding caching. |
@janakjjp if you try out the latest pre-release build you'll get the new Create PR view. It should be much faster. Please let me know if you try it out and see any noticeable perf change in either direction! |
Closing, as we don't fetch all branches before creating the view now. |
Sorry I vanished on this; I got busy with vacation and other things and wasn't working on our monorepo for a few weeks. I am running v0.72, which is from 9/8, and unfortunately the performance issue is still there; it takes ~2-3 minutes to show the list of branches. The UI is noticeably more responsive in the new view, at least, i.e. even when VSCode is churning (and pegging the CPU) there's a working indicator and the UI remains responsive to the mouse. Let me know if you still want to pursue this and I can try and spend some more time digging in. |
Since the UI shows before we have all the branches now, this is no longer blocking us from showing the Create view. @janakjjp, do you find that you need to change the branch often? If so, could you walk me through why? Here's my thinking:
Given the new Create view, I would rather see if we can improve our default branch selection than cache branches. |
I agree, caching is a pain and would not be ideal. I almost never change the branch, but it wasn't clear on the UI that I could just use the defaults. 🤔 I'll give it a try and report back. (The other issue is the CPU peg is just annoying, as everything slows down. I'd be a huge fan of defaults, and then populate everything else if you drop down the branch list. But I'll give more feedback after my next PR.) |
Repo:
git push
to a GitHub enterprise repo with thousands of branches (we have >6,000, someone should clean this up, but that's orthogonal).master
.Expected behavior:
Other notes:
master
would not appear on a repo with lots of branches; some special logic was added so that it does appear (New pull requests on branches off master try to merge into a wrong branch #3303).Let me know if I can collect any more data — this is driving me nuts, so help is appreciated 😄
The text was updated successfully, but these errors were encountered: