Skip to content

Commit

Permalink
loader: remove debug logging for 4x speedup (#37)
Browse files Browse the repository at this point in the history
This commit removes Debugf() logging, which when benchmarked with
internal runtime repos shows a 4x speedup.

TODO: replace logrus with zap.
  • Loading branch information
charlievieth authored Aug 7, 2020
1 parent 50db1c1 commit 601c1e1
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions loader/loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,6 @@ func (l *Loader) AddUpdateCallback(callback chan<- int) {

func (l *Loader) onRuntimeChanged() {
targetDir := filepath.Join(l.watchPath, l.subdirectory)
logger.Debugf("runtime changed. loading new snapshot at %s",
targetDir)

l.nextSnapshot = snapshot.New()
filepath.Walk(targetDir, l.walkDirectoryCallback)
Expand Down Expand Up @@ -83,7 +81,6 @@ func (l *Loader) walkDirectoryCallback(path string, info os.FileInfo, err error)
return nil
}

logger.Debugf("runtime: processing %s", path)
if l.ignoreDotfiles && info.IsDir() && strings.HasPrefix(info.Name(), ".") {
return filepath.SkipDir
}
Expand Down Expand Up @@ -126,8 +123,6 @@ func (l *Loader) walkDirectoryCallback(path string, info os.FileInfo, err error)
e.Uint64Valid = true
}

logger.Debugf("runtime: adding key=%s value=%s uint=%t", key,
stringValue, e.Uint64Valid)
l.nextSnapshot.SetEntry(key, e)
}

Expand Down Expand Up @@ -194,7 +189,6 @@ func New2(runtimePath, runtimeSubdirectory string, scope stats.Scope, refresher
for {
select {
case ev := <-watcher.Events:
logger.Debugf("Got event %s", ev)
if refresher.ShouldRefresh(ev.Name, getFileSystemOp(ev)) {
newLoader.onRuntimeChanged()
}
Expand Down

0 comments on commit 601c1e1

Please sign in to comment.