Setting target file count to # of CPU

This commit is contained in:
Alex Yatskov 2015-12-17 18:09:45 +09:00
parent 803f98775b
commit 18289e3c31

View File

@ -22,9 +22,10 @@
package goldsmith
import "bytes"
const TargetFileCount = 32
import (
"bytes"
"runtime"
)
type Goldsmith interface {
Chain(p Plugin) Goldsmith
@ -32,7 +33,7 @@ type Goldsmith interface {
}
func New(srcDir, dstDir string) Goldsmith {
return NewThrottled(srcDir, dstDir, TargetFileCount)
return NewThrottled(srcDir, dstDir, uint(runtime.NumCPU()))
}
func NewThrottled(srcDir, dstDir string, targetFileCount uint) Goldsmith {