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

/explore/code rendering slowly when there are many repositories (> 2000) and a logged in user #12849

Closed
2 of 7 tasks
jnlin opened this issue Sep 15, 2020 · 9 comments
Closed
2 of 7 tasks
Labels
issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented performance/speed performance issues with slow downs
Milestone

Comments

@jnlin
Copy link
Contributor

jnlin commented Sep 15, 2020

  • Gitea version (or commit ref): 6a1a633
  • Git version: 2.11.0
  • Operating system: Docker
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist: N/A

Description

We have a lot of repositories (>2000), and the rendering of /explore/code is slow (see the attached screenshot, > 17 seconds) with a logged in user.

We tried to remove some permission checking feature and the speed becomes good, however we are not sure which is the slowest part. The removed code is: master...jnlin:jnlin_test

The possible parts under suspicion are:
https://github.com/go-gitea/gitea/blob/master/routers/home.go#L330
https://github.com/go-gitea/gitea/blob/master/routers/home.go#L338-L343

Screenshots

截圖 2020-09-15 上午10 13 02

@lunny lunny added the performance/speed performance issues with slow downs label Sep 15, 2020
@lunny
Copy link
Member

lunny commented Sep 15, 2020

The differences are GetRepositoriesMapByIDs and ctx.Data["RepoMaps"] = rightRepoMap.

@jnlin
Copy link
Contributor Author

jnlin commented Sep 15, 2020

https://github.com/go-gitea/gitea/blob/master/routers/home.go#L330

This spends < 0.5 secs

https://github.com/go-gitea/gitea/blob/master/routers/home.go#L338-L343

This spends 17 secs, there may be some N+1 queries in CheckUnitUser()

@a1012112796
Copy link
Member

https://github.com/go-gitea/gitea/blob/master/routers/home.go#L330

This spends < 0.5 secs

https://github.com/go-gitea/gitea/blob/master/routers/home.go#L338-L343

This spends 17 secs, there may be some N+1 queries in CheckUnitUser()

How about #12854 ?

@jnlin
Copy link
Contributor Author

jnlin commented Sep 15, 2020

How about #12854 ?

Still needs 15 secs

image

@lunny
Copy link
Member

lunny commented Sep 16, 2020

We need more PRs here, but let's merge this one at first.

@a1012112796
Copy link
Member

Now the main issue is how to quickly find out all repos that the user has code read permission?

@jnlin
Copy link
Contributor Author

jnlin commented Sep 16, 2020

@a1012112796 yes

@stale
Copy link

stale bot commented Nov 15, 2020

This issue has been automatically marked as stale because it has not had recent activity. I am here to help clear issues left open even if solved or waiting for more insight. This issue will be closed if no further activity occurs during the next 2 weeks. If the issue is still valid just add a comment to keep it alive. Thank you for your contributions.

@stale stale bot added the issue/stale label Nov 15, 2020
@lafriks
Copy link
Member

lafriks commented Nov 15, 2020

Up

@stale stale bot removed the issue/stale label Nov 15, 2020
@lunny lunny added the issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented label Nov 16, 2020
@lafriks lafriks closed this as completed Jun 15, 2022
@lunny lunny added this to the 1.17.0 milestone Jun 16, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented performance/speed performance issues with slow downs
Projects
None yet
Development

No branches or pull requests

4 participants