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

Use underlying std::net::Ipv4Addr #26

Closed ckcr4lyf closed 1 year ago

ckcr4lyf commented 1 year ago

Removes "parsing" entirely, so getting the [u8; 6] of IP & port is much faster

benchmark:

IP str to bytes/&str    time:   [32.792 ns 32.899 ns 33.033 ns]
IP str to bytes/std::net::Ipv4Addr
                        time:   [2.0008 ns 2.0097 ns 2.0194 ns]