format_version in src/network/dpi/bittorrent.rs maps each kept byte to its own String ((b - b'0').to_string() / (b as char).to_string()), collects into a Vec<String>, then join("."). That allocates one String per byte plus the intermediate Vec on every client-version parse.
The two kept branches are also equivalent: ASCII digits are a subset of ASCII alphanumerics, and (b - b'0').to_string() equals (b as char).to_string() for digit bytes, so the digit branch is redundant.
Proposed: keep ASCII-alphanumeric bytes and push b as char into a single pre-sized String, separating with .. Same output, no per-byte String, no Vec. Happy to open the PR.
format_versioninsrc/network/dpi/bittorrent.rsmaps each kept byte to its ownString((b - b'0').to_string()/(b as char).to_string()), collects into aVec<String>, thenjoin("."). That allocates oneStringper byte plus the intermediateVecon every client-version parse.The two kept branches are also equivalent: ASCII digits are a subset of ASCII alphanumerics, and
(b - b'0').to_string()equals(b as char).to_string()for digit bytes, so the digit branch is redundant.Proposed: keep ASCII-alphanumeric bytes and push
b as charinto a single pre-sizedString, separating with.. Same output, no per-byteString, noVec. Happy to open the PR.