mirror of https://github.com/tidwall/tile38.git
Default numloops to number goprocs
This commit is contained in:
parent
7721fb8b8e
commit
6616b86eda
|
@ -22,7 +22,6 @@ import (
|
||||||
"sync/atomic"
|
"sync/atomic"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/klauspost/cpuid"
|
|
||||||
"github.com/tidwall/buntdb"
|
"github.com/tidwall/buntdb"
|
||||||
"github.com/tidwall/evio"
|
"github.com/tidwall/evio"
|
||||||
"github.com/tidwall/geojson"
|
"github.com/tidwall/geojson"
|
||||||
|
@ -295,12 +294,7 @@ func (server *Server) isProtected() bool {
|
||||||
func (server *Server) evioServe() error {
|
func (server *Server) evioServe() error {
|
||||||
var events evio.Events
|
var events evio.Events
|
||||||
if core.NumThreads == 0 {
|
if core.NumThreads == 0 {
|
||||||
cores := cpuid.CPU.PhysicalCores
|
|
||||||
if cores == 0 {
|
|
||||||
events.NumLoops = -1
|
events.NumLoops = -1
|
||||||
} else {
|
|
||||||
events.NumLoops = cores
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
events.NumLoops = core.NumThreads
|
events.NumLoops = core.NumThreads
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue