mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2025-04-28 22:25:07 +03: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:
parent
ef1e0c902f
commit
75965b6da4
6 changed files with 60 additions and 28 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue