-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
big PR view details is extremely slow #31896
Comments
Same issue here after upgrading from Gitea 1.21.8 to 1.22.3.
(It stops after 90 seconds because HAProxy timeout) The PR isn't even very big (7 changed files with 1005 additions and 219 deletions). What's also strange is that on some occasions the same page does respond quickly (Page: 1504ms Template: 1103ms). Database: PostgreSQL 14 |
Not quite sure if I'm experiencing the same issue as @phoedos, but in my case, when enabling debug logging, I see this:
So it's some git commands that are slow. |
This is similar to what's described in #31600. |
dear @jpraet
|
In my example repository, the master branch is configured as the default branch. Currently, when I click on the "PR" button, Gitea automatically computes the diff between the default branch (master) and the xCICD2 branch. I believe a possible workaround would be to defer the diff calculation until the user selects both the source and destination branches for the pull request. Anyway, performance of the diff computation should also be reviewed and optimized. |
OK. The issue you are describing now is a bit different than the issue in your original post, as now you are on the compare page to create a new PR, and not on the diff page of an actual PR. For your original issue with the PR diff page, it would be interesting to know if it's also caused by slow git.Command.Run. |
Can somebody send a branch compare or pull request to demo.gitea.com? |
Dear @jpraet yes this is a several different cases but think the root cause is the same related with diff
Hope this example will help you with investigation |
There are some configurations can be used to adjust the first time loading diff files and lines. [git]
;MAX_GIT_DIFF_LINES = 1000
;;
;; Max number of allowed characters in a line in diff view
;MAX_GIT_DIFF_LINE_CHARACTERS = 5000
;;
;; Max number of files shown in diff view
;MAX_GIT_DIFF_FILES = 100 After adjusting like below. [git]
MAX_GIT_DIFF_LINES = 300
MAX_GIT_DIFF_FILES = 30 The page will display total in 1 second on my macBook. |
made several experiments with documented options from configuration cheat sheet, reduced value
yes this options really helpful, during diff compare. If developer want to get more details in list of changed files / code lines, there is a 'Show More' button. The issue is solved now, thanks!. Hope this expirience will be helpful for other users. |
There is definitely a performance regression causing slower diffs in Gitea 1.22 vs 1.21. Closing this issue by suggesting to lower the diff size as a workaround feels to me like sweeping the problem under the rug. But I guess further discussion and problem analysis can continue in #31600. |
Description
Faced with long-time gitea work during view details of big PR
this request took up to 360(!) seconds to display page
tried made changes to indexer_type bleve->db->elasticsearch: no improvements
tried to enable Postgresql query timing: no queries with latency >100ms. 99% of gitea queries hit in <10ms responce.
Issue reproduce stable on server/local environment (SSD/nVME m2 drives), typical hdparm from drive where gitea folder is mounted:
docker-compose.yml example
Gitea Version
1.22.1
Can you reproduce the bug on the Gitea demo site?
No
Log Gist
No response
Screenshots
No response
Git Version
No response
Operating System
No response
How are you running Gitea?
docker-compose
Database
PostgreSQL
The text was updated successfully, but these errors were encountered: