Parcourir la source

lesser go procs...

willie il y a 5 ans
Parent
commit
b07b1dd33f
1 fichiers modifiés avec 3 ajouts et 1 suppressions
  1. 3 1
      GoHash.go

+ 3 - 1
GoHash.go

@@ -44,7 +44,7 @@ func init() {
 
 func main() {
 	log.Println("starting GoHash")
-	runtime.GOMAXPROCS(5)
+	runtime.GOMAXPROCS(2)
 	hashes = make(map[string]Fdhashes)
 	flag.Parse()
 	myFile := flag.Arg(0)
@@ -125,7 +125,9 @@ func outputHash(fileStr string) {
 		doHash = true
 	}
 	if doHash {
+		log.Printf("starting %s\n", fileStr)
 		hash := getSha256Hash(fileStr)
+		log.Printf("ready %s\n", fileStr)
 		mu.Lock()
 		lock1.Lock()
 		hashFile.Hashes[fileName] = hash