globalsign / mgo

The MongoDB driver for Go
Other
1.97k stars 232 forks source link

Unwanted allocs in mgo #382

Open gonejack opened 4 years ago

gonejack commented 4 years ago

The code in https://github.com/globalsign/mgo/blob/master/server.go makes quite a lot of alloc as it is just 25 millisecond, it is kind of unnecessary resource waste for us since we import mgo mainly for BSON decoding.

func init() {
    coarseTime = newcoarseTimeProvider(25 * time.Millisecond)
}

pprof.alloc_objects.alloc_space.inuse_objects.inuse_space.003.pb.gz