Merge pull request #4353 from MichaelEischer/tune-gc

Tune Go garbage collector
This commit is contained in:
Michael Eischer
2023-06-16 23:24:39 +02:00
committed by GitHub
4 changed files with 23 additions and 0 deletions

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)