You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gitea/models
Lunny Xiao fbe6d9dc6b
Use batch database operations instead of one by one to optimze api pulls (#32680)
Resolve #31492

The response time for the Pull Requests API has improved significantly,
dropping from over `2000ms` to about `350ms` on my local machine. It's
about `6` times faster.

A key area for further optimization lies in batch-fetching data for
`apiPullRequest.ChangedFiles, apiPullRequest.Additions, and
apiPullRequest.Deletions`.

Tests `TestAPIViewPulls` does exist and new tests added.

- This PR also fixes some bugs in `GetDiff` functions.
- This PR also fixes data inconsistent in test data. For a pull request,
the head branch's reference should be equal to the reference in
`pull/xxx/head`.
3 months ago
..
actions Trim title before insert/update to database to match the size requirements of database (#32498) 4 months ago
activities Move GetFeeds to service layer (#32526) 3 months ago
admin Fix javascript error when an anonymous user visiting migration page (#32144) 5 months ago
asymkey bump to go 1.23 (#31855) 6 months ago
auth Fix: passkey login not working anymore (#32623) 4 months ago
avatars Replace 10 more gt- classes with tw- (#29945) 12 months ago
db Fix: passkey login not working anymore (#32623) 4 months ago
dbfs Enable `unparam` linter (#31277) 9 months ago
fixtures Use batch database operations instead of one by one to optimze api pulls (#32680) 3 months ago
git Add priority to protected branch (#32286) 4 months ago
issues Use batch database operations instead of one by one to optimze api pulls (#32680) 3 months ago
migrations Issue time estimate, meaningful time tracking (#23113) 3 months ago
organization Use batch database operations instead of one by one to optimze api pulls (#32680) 3 months ago
packages Add Arch package registry (#32692) 3 months ago
perm Move AddCollabrator and CreateRepositoryByExample to service layer (#32419) 4 months ago
project Trim title before insert/update to database to match the size requirements of database (#32498) 4 months ago
pull Add support for sha256 repositories (#23894) 1 year ago
renderhelper Refactor render system (orgmode) (#32671) 3 months ago
repo Fix issue title rendering and refactor legacy function names (#32703) 3 months ago
secret Clarify Actions resources ownership (#31724) 7 months ago
shared/types Refactor locale&string&template related code (#29165) 1 year ago
system Refactor deletion (#28610) 1 year ago
unit Add `DEFAULT_MIRROR_REPO_UNITS` and `DEFAULT_TEMPLATE_REPO_UNITS` options (#32416) 4 months ago
unittest Refactor markup render system (#32612) 4 months ago
user Strict pagination check (#32548) 4 months ago
webhook Store webhook event in database (#29145) 1 year ago
error.go Add merge style `fast-forward-only` (#28954) 1 year ago
main_test.go make writing main test easier (#27270) 1 year ago
repo.go Refactor deletion (#28610) 1 year ago
repo_test.go Penultimate round of `db.DefaultContext` refactor (#27414) 1 year ago
repo_transfer.go chore: use errors.New to replace fmt.Errorf with no parameters will much better (#30621) 11 months ago