forgejo/routers/web/repo
Rowan Bohde befafe9a05
improve performance of diffs (#32393)
This has two major changes that significantly reduce the amount of work
done for large diffs:

* Kill a running git process when reaching the maximum number of files
in a diff, preventing it from processing the entire diff.
* When loading a diff with the URL param `file-only=true`, skip loading
stats. This speeds up loading both hidden files of a diff and sections
of a diff when clicking the "Show More" button.

A couple of minor things from profiling are also included:

* Reuse existing repo in `PrepareViewPullInfo` if head and base are the
same.

The performance impact is going to depend heavily on the individual diff
and the hardware it runs on, but when testing locally on a diff changing
100k+ lines over hundreds of files, I'm seeing a roughly 75% reduction
in time to load the result of "Show More"

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit 7dcccc3bb19655a6f83dd495ffc332708d0c8678)
2024-11-05 09:39:21 +01:00
..
actions Fix missing signature key error when pulling Docker images with SERVE_DIRECT enabled (#32365) 2024-11-05 09:33:15 +01:00
badges
flags
setting fix: don't cancel schedule workflows on push to main branch 2024-10-05 12:14:44 +02:00
activity.go refactor: remove redundant err declarations (#32381) 2024-11-05 09:33:15 +01:00
attachment.go Fix missing signature key error when pulling Docker images with SERVE_DIRECT enabled (#32365) 2024-11-05 09:33:15 +01:00
blame.go
branch.go Hide the "Details" link of commit status when the user cannot access actions (#30156) 2024-08-04 08:47:07 +02:00
cherry_pick.go
code_frequency.go
commit.go improve performance of diffs (#32393) 2024-11-05 09:39:21 +01:00
compare.go improve performance of diffs (#32393) 2024-11-05 09:39:21 +01:00
contributors.go
download.go Fix missing signature key error when pulling Docker images with SERVE_DIRECT enabled (#32365) 2024-11-05 09:33:15 +01:00
editor.go
editor_test.go [TESTS] Fix usage of LoadRepoCommit 2024-08-26 08:03:48 +02:00
find.go
githttp.go [PORT] Fix git error handling (gitea#32401) 2024-11-03 16:47:44 +01:00
githttp_test.go
helper.go
helper_test.go
issue.go feat: combine review requests comments 2024-10-25 22:57:32 +02:00
issue_content_history.go feat: Improve diff being generated 2024-08-26 13:58:17 +02:00
issue_dependency.go
issue_label.go
issue_label_test.go Add testifylint to lint checks (#4535) 2024-07-30 19:41:10 +00:00
issue_lock.go
issue_pin.go
issue_stopwatch.go
issue_test.go feat: combine review requests comments 2024-10-25 22:57:32 +02:00
issue_timetrack.go
issue_watch.go
main_test.go
middlewares.go
migrate.go feat(i18n): allow different translations of creation links and titles (#4829) 2024-08-07 16:54:05 +00:00
milestone.go
packages.go
patch.go
projects.go
projects_test.go
pull.go improve performance of diffs (#32393) 2024-11-05 09:39:21 +01:00
pull_review.go Revert "Prevent allow/reject reviews on merged/closed PRs" 2024-08-12 12:24:52 +01:00
pull_review_test.go Add testifylint to lint checks (#4535) 2024-07-30 19:41:10 +00:00
recent_commits.go
release.go feat: Add Search to Releases Page 2024-11-02 10:24:35 +01:00
release_test.go Add testifylint to lint checks (#4535) 2024-07-30 19:41:10 +00:00
render.go
repo.go Fix missing signature key error when pulling Docker images with SERVE_DIRECT enabled (#32365) 2024-11-05 09:33:15 +01:00
search.go ui(code-search): fix to use CodeSearchMode 2024-09-16 16:20:55 +02:00
topic.go
treelist.go
view.go refactor: remove redundant err declarations (#32381) 2024-11-05 09:33:15 +01:00
view_test.go
wiki.go Fix wiki revision pagination (#31760) 2024-08-04 18:24:10 +02:00
wiki_test.go Add testifylint to lint checks (#4535) 2024-07-30 19:41:10 +00:00