mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-31 10:56:10 +01:00 
			
		
		
		
	Performance improvement for last commit cache and show-ref (#15455)
* Improve performance when there are multiple commits in the last commit cache * read refs directly if we can Signed-off-by: Andrew Thornton <art27@cantab.net>
This commit is contained in:
		| @@ -102,10 +102,13 @@ func (tes Entries) GetCommitsInfo(commit *Commit, treePath string, cache *LastCo | ||||
| } | ||||
|  | ||||
| func getLastCommitForPathsByCache(commitID, treePath string, paths []string, cache *LastCommitCache) (map[string]*Commit, []string, error) { | ||||
| 	wr, rd, cancel := CatFileBatch(cache.repo.Path) | ||||
| 	defer cancel() | ||||
|  | ||||
| 	var unHitEntryPaths []string | ||||
| 	var results = make(map[string]*Commit) | ||||
| 	for _, p := range paths { | ||||
| 		lastCommit, err := cache.Get(commitID, path.Join(treePath, p)) | ||||
| 		lastCommit, err := cache.Get(commitID, path.Join(treePath, p), wr, rd) | ||||
| 		if err != nil { | ||||
| 			return nil, nil, err | ||||
| 		} | ||||
|   | ||||
		Reference in New Issue
	
	Block a user