-
-
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
improve performance of diffs #32393
improve performance of diffs #32393
Conversation
Here are quick before & after videos showcasing viewing the files in a large pull request: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could vote my approval (although the error handling seems strange, I might propose some following PRs if I could get a clear picture for it).
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: * Reuse open git commits if possible to avoid querying the repo. * Reuse existing repo in `PrepareViewPullInfo` if head and base are the same.
2f443b2
to
69acf6a
Compare
We need this to correctly handle the errors: Fix git error handling #32401 |
* giteaofficial/main: (21 commits) Use 8 as default value for git lfs concurrency (go-gitea#32421) Fix milestone deadline and date related problems (go-gitea#32339) Only query team tables if repository is under org when getting assignees (go-gitea#32414) Refactor RepoRefByType (go-gitea#32413) Refactor template ctx and render utils (go-gitea#32422) Refactor DateUtils and merge TimeSince (go-gitea#32409) Refactor markup package (go-gitea#32399) Add some handy markdown editor features (go-gitea#32400) Make LFS http_client parallel within a batch. (go-gitea#32369) Refactor repo legacy (go-gitea#32404) Replace DateTime with proper functions (go-gitea#32402) Fix git error handling (go-gitea#32401) Fix created_unix for mirroring (go-gitea#32342) Replace DateTime with DateUtils (go-gitea#32383) improve performance of diffs (go-gitea#32393) Refactor tests to prevent from unnecessary preparations (go-gitea#32398) Add artifacts test fixture (go-gitea#30300) Fix `missing signature key` error when pulling Docker images with `SERVE_DIRECT` enabled (go-gitea#32365) Fix a number of typescript issues (go-gitea#32308) Update go dependencies (go-gitea#32389) ...
This has two major changes that significantly reduce the amount of work done for large diffs:
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:
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"