0
0
mirror of https://github.com/go-gitea/gitea.git synced 2024-12-19 00:00:34 +01:00
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`.
2024-12-11 05:15:06 +08:00
..
actions Trim title before insert/update to database to match the size requirements of database (#32498) 2024-11-14 07:19:14 +00:00
activities Move GetFeeds to service layer (#32526) 2024-11-29 17:53:49 +00:00
admin Fix javascript error when an anonymous user visiting migration page (#32144) 2024-10-02 04:37:16 +00:00
asymkey bump to go 1.23 (#31855) 2024-09-10 02:23:07 +00:00
auth Fix: passkey login not working anymore (#32623) 2024-11-26 16:04:17 +00:00
avatars Replace 10 more gt- classes with tw- (#29945) 2024-03-22 13:45:10 +00:00
db Fix: passkey login not working anymore (#32623) 2024-11-26 16:04:17 +00:00
dbfs Enable unparam linter (#31277) 2024-06-11 18:47:45 +00:00
fixtures Use batch database operations instead of one by one to optimze api pulls (#32680) 2024-12-11 05:15:06 +08:00
git Add priority to protected branch (#32286) 2024-11-27 05:41:06 +01:00
issues Use batch database operations instead of one by one to optimze api pulls (#32680) 2024-12-11 05:15:06 +08:00
migrations Issue time estimate, meaningful time tracking (#23113) 2024-12-05 13:07:53 +00:00
organization Use batch database operations instead of one by one to optimze api pulls (#32680) 2024-12-11 05:15:06 +08:00
packages Add Arch package registry (#32692) 2024-12-04 23:09:07 +00:00
perm Move AddCollabrator and CreateRepositoryByExample to service layer (#32419) 2024-11-07 11:28:11 +08:00
project Trim title before insert/update to database to match the size requirements of database (#32498) 2024-11-14 07:19:14 +00:00
pull Add support for sha256 repositories (#23894) 2024-01-19 17:05:02 +01:00
renderhelper Refactor render system (orgmode) (#32671) 2024-11-29 16:08:29 +08:00
repo Fix issue title rendering and refactor legacy function names (#32703) 2024-12-04 01:39:33 +00:00
secret Clarify Actions resources ownership (#31724) 2024-08-01 09:04:04 +00:00
shared/types Refactor locale&string&template related code (#29165) 2024-02-14 21:48:45 +00:00
system Refactor deletion (#28610) 2023-12-25 21:25:29 +01:00
unit Add DEFAULT_MIRROR_REPO_UNITS and DEFAULT_TEMPLATE_REPO_UNITS options (#32416) 2024-11-11 00:11:00 +00:00
unittest Refactor markup render system (#32612) 2024-11-24 16:18:57 +08:00
user Strict pagination check (#32548) 2024-11-25 09:56:50 +08:00
webhook Store webhook event in database (#29145) 2024-03-07 23:18:38 +01:00
error.go Add merge style fast-forward-only (#28954) 2024-02-12 23:37:23 +01:00
main_test.go
repo_test.go
repo_transfer.go chore: use errors.New to replace fmt.Errorf with no parameters will much better (#30621) 2024-04-21 19:44:03 +00:00
repo.go Refactor deletion (#28610) 2023-12-25 21:25:29 +01:00