Switch connAddr (udp map key) from string to a struct that allocates less. Reduce some other allocations. Use larger channel buffers to reduce backpressure from runtime jitter.

This commit is contained in:
Arceliar 2018-01-13 07:26:26 -06:00
parent ef1e0c902f
commit 75965b6da4
6 changed files with 60 additions and 28 deletions

View file

@ -164,8 +164,8 @@ func (ss *sessions) createSession(theirPermKey *boxPubKey) *sessionInfo {
sinfo.myHandle = *newHandle()
sinfo.theirAddr = *address_addrForNodeID(getNodeID(&sinfo.theirPermPub))
sinfo.theirSubnet = *address_subnetForNodeID(getNodeID(&sinfo.theirPermPub))
sinfo.send = make(chan []byte, 1)
sinfo.recv = make(chan *wire_trafficPacket, 1)
sinfo.send = make(chan []byte, 1024)
sinfo.recv = make(chan *wire_trafficPacket, 1024)
go sinfo.doWorker()
sinfo.time = time.Now()
// Do some cleanup