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 package goldsmith
import "bytes" import (
"bytes"
const TargetFileCount = 32 "runtime"
)
type Goldsmith interface { type Goldsmith interface {
Chain(p Plugin) Goldsmith Chain(p Plugin) Goldsmith
@ -32,7 +33,7 @@ type Goldsmith interface {
} }
func New(srcDir, dstDir string) Goldsmith { 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 { func NewThrottled(srcDir, dstDir string, targetFileCount uint) Goldsmith {