Skip to content
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

Use gitrepo.GetTreePathLatestCommit to get file lastest commit instead from latest commit cache #32987

Merged
merged 13 commits into from
Dec 30, 2024

Conversation

lunny
Copy link
Member

@lunny lunny commented Dec 26, 2024

The latest commit cache is currently used only for listing tree files. However, a cold start may take longer than directly invoking the Git command. This PR addresses the issue of slow response times when accessing raw files, improving performance in such scenarios.

gitea.log:105521:2024/12/23 08:22:18 ...eb/routing/logger.go:68:func1() [W] router: slow      GET /xxxx/xxxxxx/raw/commit/xxxxxxxxxxxxxxxxxxxxxxxxxxx/.editorconfig for 172.18.0.5:53252, elapsed 3526.8ms @ repo/download.go:117(repo.SingleDownload)

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Dec 26, 2024
@pull-request-size pull-request-size bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Dec 26, 2024
@github-actions github-actions bot added modifies/api This PR adds API routes or modifies them modifies/go Pull requests that update Go code labels Dec 26, 2024
@lunny lunny added performance/speed performance issues with slow downs backport/v1.23 This PR should be backported to Gitea 1.23 and removed modifies/api This PR adds API routes or modifies them modifies/go Pull requests that update Go code labels Dec 26, 2024
@lunny lunny added this to the 1.24.0 milestone Dec 26, 2024
@lunny lunny force-pushed the lunny/improve_get_treepath_latest_commit branch from 7162f0c to e0f7b89 Compare December 26, 2024 04:59
@github-actions github-actions bot added modifies/api This PR adds API routes or modifies them modifies/go Pull requests that update Go code labels Dec 26, 2024
@pull-request-size pull-request-size bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Dec 26, 2024
@pull-request-size pull-request-size bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Dec 26, 2024
@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Dec 28, 2024
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Dec 30, 2024
@lunny lunny added the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Dec 30, 2024
@lunny lunny enabled auto-merge (squash) December 30, 2024 02:35
@lunny lunny merged commit f4ccbd3 into go-gitea:main Dec 30, 2024
26 checks passed
@GiteaBot GiteaBot removed the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Dec 30, 2024
GiteaBot pushed a commit to GiteaBot/gitea that referenced this pull request Dec 30, 2024
…d from latest commit cache (go-gitea#32987)

The latest commit cache is currently used only for listing tree files.
However, a cold start may take longer than directly invoking the Git
command. This PR addresses the issue of slow response times when
accessing raw files, improving performance in such scenarios.

```log
gitea.log:105521:2024/12/23 08:22:18 ...eb/routing/logger.go:68:func1() [W] router: slow      GET /xxxx/xxxxxx/raw/commit/xxxxxxxxxxxxxxxxxxxxxxxxxxx/.editorconfig for 172.18.0.5:53252, elapsed 3526.8ms @ repo/download.go:117(repo.SingleDownload)
```
@GiteaBot GiteaBot added the backport/done All backports for this PR have been created label Dec 30, 2024
@wxiaoguang wxiaoguang deleted the lunny/improve_get_treepath_latest_commit branch December 30, 2024 04:53
lunny pushed a commit that referenced this pull request Dec 30, 2024
zjjhot added a commit to zjjhot/gitea that referenced this pull request Dec 31, 2024
* giteaofficial/main:
  Fix issue comment number (go-gitea#30556)
  Fix duplicate co-author in squashed merge commit messages (go-gitea#33020)
  Merge updatecommentattachment functions (go-gitea#33044)
  Move SetMerged to service layer (go-gitea#33045)
  Remove aws go sdk package dependency (go-gitea#33029)
  Fix settings not being loaded at CLI (go-gitea#26402)
  Refactor fixture loading for testing (go-gitea#33024)
  Use gitrepo.GetTreePathLatestCommit to get file lastest commit instead from latest commit cache (go-gitea#32987)
  Fix bug automerge cannot be chosed when there is only 1 merge style (go-gitea#33040)
  use `-s -w` ldflags for release artifacts (go-gitea#33041)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/done All backports for this PR have been created backport/v1.23 This PR should be backported to Gitea 1.23 lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. modifies/api This PR adds API routes or modifies them modifies/go Pull requests that update Go code performance/speed performance issues with slow downs size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants