mirror of
https://github.com/go-gitea/gitea.git
synced 2026-03-09 04:25:18 -05:00
It takes a long time to open a big pull request page #6897
Closed
opened 2025-11-02 07:10:25 -06:00 by GiteaMirror
·
35 comments
No Branch/Tag Specified
main
release/v1.25
release/v1.24
release/v1.23
release/v1.22
release/v1.21
release/v1.20
release/v1.19
release/v1.18
release/v1.17
release/v1.16
release/v1.15
release/v1.14
release/v1.13
release/v1.12
release/v1.11
release/v1.10
release/v1.9
release/v1.8
v1.25.3
v1.25.2
v1.25.1
v1.25.0
v1.24.7
v1.25.0-rc0
v1.26.0-dev
v1.24.6
v1.24.5
v1.24.4
v1.24.3
v1.24.2
v1.24.1
v1.24.0
v1.23.8
v1.24.0-rc0
v1.25.0-dev
v1.23.7
v1.23.6
v1.23.5
v1.23.4
v1.23.3
v1.23.2
v1.23.1
v1.23.0
v1.23.0-rc0
v1.24.0-dev
v1.22.6
v1.22.5
v1.22.4
v1.22.3
v1.22.2
v1.22.1
v1.22.0
v1.23.0-dev
v1.22.0-rc1
v1.21.11
v1.22.0-rc0
v1.21.10
v1.21.9
v1.21.8
v1.21.7
v1.21.6
v1.21.5
v1.21.4
v1.21.3
v1.21.2
v1.20.6
v1.21.1
v1.21.0
v1.21.0-rc2
v1.21.0-rc1
v1.20.5
v1.22.0-dev
v1.21.0-rc0
v1.20.4
v1.20.3
v1.20.2
v1.20.1
v1.20.0
v1.19.4
v1.21.0-dev
v1.20.0-rc2
v1.20.0-rc1
v1.20.0-rc0
v1.19.3
v1.19.2
v1.19.1
v1.19.0
v1.19.0-rc1
v1.20.0-dev
v1.19.0-rc0
v1.18.5
v1.18.4
v1.18.3
v1.18.2
v1.18.1
v1.18.0
v1.17.4
v1.18.0-rc1
v1.19.0-dev
v1.18.0-rc0
v1.17.3
v1.17.2
v1.17.1
v1.17.0
v1.17.0-rc2
v1.16.9
v1.17.0-rc1
v1.18.0-dev
v1.16.8
v1.16.7
v1.16.6
v1.16.5
v1.16.4
v1.16.3
v1.16.2
v1.16.1
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c1
v1.3.2
v1.3.1
v1.3.0
v1.3.0-rc2
v1.3.0-rc1
v1.2.3
v1.2.2
v1.2.1
v1.2.0
v1.2.0-rc3
v1.2.0-rc2
v1.1.4
v1.2.0-rc1
v1.1.3
v1.1.2
v1.1.1
v1.1.0
v1.0.2
v1.0.1
v1.0.0
v0.9.99
Labels
Clear labels
$20
$250
$50
$500
backport/done
💎 Bounty
docs-update-needed
good first issue
hacktoberfest
issue/bounty
issue/confirmed
issue/critical
issue/duplicate
issue/needs-feedback
issue/not-a-bug
issue/regression
issue/stale
issue/workaround
lgtm/need 2
modifies/api
modifies/translation
outdated/backport/v1.18
outdated/theme/markdown
outdated/theme/timetracker
performance/bigrepo
performance/cpu
performance/memory
performance/speed
pr/breaking
proposal/accepted
proposal/rejected
pr/wip
pull-request
reviewed/wontfix
💰 Rewarded
skip-changelog
status/blocked
topic/accessibility
topic/api
topic/authentication
topic/build
topic/code-linting
topic/commit-signing
topic/content-rendering
topic/deployment
topic/distribution
topic/federation
topic/gitea-actions
topic/issues
topic/lfs
topic/mobile
topic/moderation
topic/packages
topic/pr
topic/projects
topic/repo
topic/repo-migration
topic/security
topic/theme
topic/ui
topic/ui-interaction
topic/ux
topic/webhooks
topic/wiki
type/bug
type/deprecation
type/docs
type/enhancement
type/feature
type/miscellaneous
type/proposal
type/question
type/refactoring
type/summary
type/testing
type/upstream
Mirrored from GitHub Pull Request
No Label
performance/speed
Milestone
No items
No Milestone
Projects
Clear projects
No project
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/gitea#6897
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @ffbh123456 on GitHub (Feb 18, 2021).
Gitea version 1.14.0+dev-449-ge0c753e77 built with GNU Make 4.3, go1.15.6 : bindata, timetzdata, sqlite, sqlite_unlock_notify
The gitea server is deployed locally. I made a pull request and changed more than 100 files and more than 1,000 lines. It took me nearly two minutes to open this pull request page.

I looked at the log, mainly because these two API return very slowly, both of which are about one minute
Are there any configuration items that can improve the speed here?
@lunny commented on GitHub (Feb 18, 2021):
How many files and lines changed on this PR?
@tomaswarynyca commented on GitHub (Feb 18, 2021):
An example https://gitea.com/gitea/tea/pulls/316/files
I think you should put a limit to the amount of content displayed and if the user requires more by clicking on a button to load more content.
@ffbh123456 commented on GitHub (Feb 19, 2021):
@lunny
100 file, 1000 add line, 1000 delete line, every file about 10 add line and 10 delete line.
@PhenX commented on GitHub (Feb 19, 2021):
I agree that the pull request page can be very hard to use, even more when dealing with many files. One solution would be to show a tree of the modified files and show the diff when clicking on those files. We had this on bitbucket and that was really better than to have everything on the same page.
This would solve the problem for this kind of pull request, and I personally find it way better.
All my colleagues agree with this, they miss this feature.
@bartkaptur commented on GitHub (Feb 20, 2021):
Same problem here. Setting DISABLE_DIFF_HIGHLIGHT = true helps, but only gets you so far. The HTML generated for a pull request is highly complicated and gets huge quickly. A new, simplified mode for this view would be useful.
@primesun commented on GitHub (May 8, 2021):
In my opinion the ideal solution would be to have a file tree on the pull request page, and you would click to select one file diff at a time.
@PhenX commented on GitHub (May 10, 2021):
Hello, to follow up on my last message about the pull request page, I started a project built on AspNet Core (5.0, but might work easily on 3.1 or even 2.1 as the backend is rather simple, no database required, everything is done via API) and VueJS for the front end.
It uses the Gitea API to provide :
I'm planning to release it as open source when I think it's less buggy, but a few members of my team already use it (I do everyday).
Here is what it loooks like :

@zeripath commented on GitHub (May 11, 2021):
Yes this is a known problem.
I know how to solve it but I still haven't been able to get round to it.
We need to make the diff page in sections and farm parts of it off to Ajax and other requests.
@typeless commented on GitHub (Jun 9, 2021):
I have seen this issue too.
The bottleneck appears to be in the syntax highlight library.
I sampled the stack trace when my Gitea was hanging on showing pull diffs and got the following:
@typeless commented on GitHub (Jun 16, 2021):
Looking at
7e282be495/lexers/internal/api.go (L91-L98), I am afraid it's noticeably expensive to search for a lexer for every line of code.See also
f4d3bf7867/services/gitdiff/gitdiff.go (L551)@typeless commented on GitHub (Jun 22, 2021):
Infinite scrolling pagination (https://www.digitalocean.com/community/tutorials/vuejs-implementing-infinite-scroll) might be a relatively simple way to address this if it doesn't require redesigning the UI.
@zeripath commented on GitHub (Jun 24, 2021):
I guess that shows where we can seriously improve then...
The lexer detection should be run on the old file and run on the new file once and then reused.
@typeless commented on GitHub (Jun 24, 2021):
@zeripath
#16180 helps to some extent, yet it's still suboptimal.
For the record, I have a PR that translates into 40MB of HTML and takes 10mins to generate (73 added files, btw). It seems to be stuck in
html/templateforever. Given the scenario, I think AJAX would probably make more difference in fixing this problem.@zeripath commented on GitHub (Jun 24, 2021):
Yeah
@zeripath commented on GitHub (Jun 24, 2021):
Agh I just read that pr. We need to change it. I don't think we can use arccache - it should be twoqueue I think
@typeless commented on GitHub (Jun 24, 2021):
Can you elaborate on their differences in this use case?
@zeripath commented on GitHub (Jun 24, 2021):
the issue is ARCCache is patent encumbered and known to be patent encumbered. We can't/shouldn't use that until the ARCCache patents expire - which it's potentially not until 2024 although someone says it's 2022.
@zeripath commented on GitHub (Jun 24, 2021):
We should use a TwoQueue as the documentation for that library suggests which is equivalent but without the patent problem.
@typeless commented on GitHub (Jun 24, 2021):
@zeripath I see. I'll submit a pr later.
@leeN commented on GitHub (Nov 15, 2021):
This (sadly) makes Gitea more or less unusable for managing forks of large projects. We have forked a large open source project with a very active upstream so merging in new versions will easily pull in 15k+ new commits and 50k changed files.
Even trying to create a pull request via the web view hangs forever, commenting on it is pretty much impossible too :/
Gitea Version: 1.15.6
OS: Linux
Storage: SSDs (Raid1)
DB: Postgres
@lunny commented on GitHub (Nov 15, 2021):
I'm interested in what's the open source project.
@leeN commented on GitHub (Nov 15, 2021):
Firefox, I merged in all changes between version 80 and 84 into our fork and the pull request page loads forever.
@leeN commented on GitHub (Nov 16, 2021):
As a point of reference, I opened it on the Github Upstream repo. This took like 1s to load compared with the infinite loading time with Gitea.
@lunny commented on GitHub (Nov 16, 2021):
Yeah, because github will hide the changes. If you cannot view the changes, the PR cannot be reviewed manually.
@leeN commented on GitHub (Nov 16, 2021):
I completely agree that it is impossible to review change sets that large in the web UI. If the UI doesn't render at all however, commenting on the pull request becomes impossible too as the comment box is rendered after all commits have loaded. This makes giving feedback based on checking out the PR locally via Gitea kinda impossible :)
I'm well aware that this is an edge case, but the option to hide the commits/changes similar to Github, if the change set is too large, would be a super helpful addition to Gitea :)
@lunny commented on GitHub (Nov 17, 2021):
OKay. So we can add an option to hide the file changes in the web UI but allow to create the PR successfully.
@leeN commented on GitHub (Nov 17, 2021):
That would be fantastic! :)
@NicolasPA commented on GitHub (Dec 10, 2021):
Similarly to the idea of having a tree of files that can be clicked to show the diff for one file, it would also be very useful to be able to select only one or more commits of the PR, which would also reduce the amount of diff displayed. This is the "Changes from" menu in Github:

@zeripath commented on GitHub (Dec 15, 2021):
AHA!
I bet you have some broken git repositories! I've just discovered that
git cat-file --batchandgit cat-file --batch-checkwill both hang until stdin is closed if the underlying "repository" is not a git repository. This is an infuriatingly bad behaviour which means we'll need to rungit rev-parseon repository "open" to prevent the problem.@gempir commented on GitHub (Feb 22, 2023):
FYI for readers: These settings have the most impact on the performance of the files changed page.
play around with them and figure out what works for you. I still think Bitbucket Server always had a really great concept for loading diffs, since it only ever had a single file open and you could just click in the file picker to the next one.
Rarely did I want to scroll through multiple files, since when are files vertically aligned to each other, they are always in a file system not a vertical line.
Is there lexer problem still relevant? Does it still look into the lexer for each line? I might want to have a look into that if so.
@gempir commented on GitHub (Feb 22, 2023):
An alternative Idea could be building a Diff Viewer completely separate from the current one and implementing it purely in vuejs.
Syntax Highlighting has to be figured out then, but I think overall it could lead to a more customizable experience than the current server-client hybrid.
Although I really wish gitea could support vuejs SSR somehow, I'm not familiar enough with vuejs to judge if that's easy enough to implement.
@thigg commented on GitHub (Apr 18, 2023):
That would be a great hotfix to allow to show only one file at a time. I imagine it would be easy to implement and a very stable fallback mechanism until infinite scrolling etc stabilized. (reviewing large PRs got better recently but it is still very annoying)
Can someone outline what would have to be done for that?
@lunny commented on GitHub (Apr 18, 2023):
I think #16829 has resolve this problem. You can set
to limit the files loaded every time. And click
Load Morebutton on the bottom to load another page.@lunny commented on GitHub (Jul 3, 2023):
Closed since loading files could be configured and there is a
Load Morebutton.@thigg commented on GitHub (Jul 3, 2023):
I tried this with the current deployment on try: https://try.gitea.io/thigg/podqast/pulls/1/files
with 85k additions and 12k deletions and even though the site is loading in a matter of 10s of seconds I can not really type comments in there as there is a several seconds lag between typing and seeing the letter on the screen.
@lunny should this be a separate/new issue?
I agree that you should not have PRs this big... but if you get into the situation for some reason, it would be nice if at least gitea would not get in your way too.