-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Wiki overview of pages is loading slowly #20156
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
Labels
Milestone
Comments
Obviously for every page in the list, it will invoke a git command below. There are over 100 pages in this list. That's why it's slow.
Take a look at the code, it just wants to get the updated time of the file from git log. entries, err := commit.ListEntries()
if err != nil {
ctx.ServerError("ListEntries", err)
return
}
pages := make([]PageMeta, 0, len(entries))
for _, entry := range entries {
if !entry.IsRegular() {
continue
}
c, err := wikiRepo.GetCommitByPath(entry.Name())
if err != nil {
ctx.ServerError("GetCommit", err)
return
}
wikiName, err := wiki_service.FilenameToName(entry.Name())
if err != nil {
if models.IsErrWikiInvalidFileName(err) {
continue
}
ctx.ServerError("WikiFilenameToName", err)
return
}
pages = append(pages, PageMeta{
Name: wikiName,
SubURL: wiki_service.NameToSubURL(wikiName),
UpdatedUnix: timeutil.TimeStamp(c.Author.When.Unix()),
})
} |
lunny
added a commit
that referenced
this issue
Dec 6, 2024
Backport #32732 by @lunny Fix #20156 We reuse the code from the repository code view instead of the current code. Previously it took `5653ms` for https://gitea.com/henri/wiki/wiki/?action=_pages in my local machine, now it's about `300ms` . Co-authored-by: Lunny Xiao <[email protected]>
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Description
Yesterday I searched for a example
_Sidebar.md
for the wiki pages, especially how to link to other pages. While doing so I thought Gitea.com may has some wikis with a sidebar and I discovered the following repo: https://gitea.com/henri/wiki/wiki/?action=_pages , but this page is loading very slowly, page: ~11s, template: ~5ms.Gitea Version
1.18.0+dev-14-g1e2c2edab
Can you reproduce the bug on the Gitea demo site?
Yes
Log Gist
No response
Screenshots
Git Version
No response
Operating System
No response
How are you running Gitea?
I discovered the bug on https://gitea.com. I guess it's using MySQL as discussed on discord.
Database
MySQL
The text was updated successfully, but these errors were encountered: