ckcr4lyf / kiryuu

A highly performant HTTP bittorrent tracker (WIP)
Do What The F*ck You Want To Public License
13 stars 3 forks source link

vec vs u8 #24

Closed ckcr4lyf closed 1 year ago

ckcr4lyf commented 1 year ago

We know it's only 6 bytes, don't need vec

ckcr4lyf commented 1 year ago

image

Redis performance is indifferent

However, the initial parsing into the [u8; 6] is faster than Vec<u8> :

IP str to bytes/vec     time:   [120.36 ns 123.52 ns 126.92 ns]
IP str to bytes/u8      time:   [32.511 ns 32.607 ns 32.715 ns]