mirror of
https://github.com/cwinfo/yggdrasil-go.git
synced 2025-07-15 02:08:56 +00:00
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:
@ -44,6 +44,14 @@ func wire_put_uint64(elem uint64, out []byte) []byte {
|
||||
return append(out, bs...)
|
||||
}
|
||||
|
||||
func wire_uint64_len(elem uint64) int {
|
||||
l := 1
|
||||
for e := elem >> 7; e > 0; e >>= 7 {
|
||||
l++
|
||||
}
|
||||
return l
|
||||
}
|
||||
|
||||
// Decode uint64 from a []byte slice
|
||||
// Returns the decoded uint64 and the number of bytes used
|
||||
func wire_decode_uint64(bs []byte) (uint64, int) {
|
||||
|
Reference in New Issue
Block a user