Merge pull request #4353 from MichaelEischer/tune-gc

Tune Go garbage collector
This commit is contained in:
Michael Eischer authored and GitHub committed 2023-06-16 23:24:39 +02:00
commit 191c47d30e
4 files changed
+23

No files matched your search

+4
View File
@@ -7,6 +7,7 @@ import (
"fmt"
"io"
"os"
"runtime"
"sort"
"sync"
@@ -601,6 +602,9 @@ func (r *Repository) LoadIndex(ctx context.Context) error {
return err
}
// Trigger GC to reset garbage collection threshold
runtime.GC()
if r.cfg.Version < 2 {
// sanity check
ctx, cancel := context.WithCancel(ctx)