Address run/create performance issues

Fixed the logic where we observed different performance
results when running an image by its fqname vs a shortname. In
the case of the latter, we resolve the name without using the
network.

Signed-off-by: baude <bbaude@redhat.com>

Closes: #37
Approved by: rhatdan
This commit is contained in:
baude
2017-11-13 12:40:21 -06:00
committed by Atomic Bot
parent 7df3221232
commit 5cfd7a313f
4 changed files with 97 additions and 16 deletions

View File

@ -1,8 +1,10 @@
package libpod
import (
"fmt"
"os"
"path/filepath"
"time"
)
// WriteFile writes a provided string to a provided path
@ -32,3 +34,11 @@ func StringInSlice(s string, sl []string) bool {
}
return false
}
// FuncTimer helps measure the execution time of a function
// For debug purposes, do not leave in code
// used like defer FuncTimer("foo")
func FuncTimer(funcName string) {
elapsed := time.Since(time.Now())
fmt.Printf("%s executed in %d ms\n", funcName, elapsed)
}