mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-04-01 10:15:31 +00:00
aquatic_http: rewrite request parsing, use smartstring
Use smartstring in PeerMapKey too. Improves benchmark speed. request-from-path: time: [2.1484 us 2.1530 us 2.1586 us] change: [-24.246% -23.908% -23.570%] (p = 0.00 < 0.01) Performance has improved.
This commit is contained in:
parent
fc9b4c8e0d
commit
9df1f0ecc6
10 changed files with 1069 additions and 1057 deletions
|
|
@ -1,12 +1,13 @@
|
|||
use std::net::{Ipv4Addr, Ipv6Addr};
|
||||
|
||||
use serde::Serializer;
|
||||
use smartstring::{SmartString, LazyCompact};
|
||||
|
||||
use super::response::ResponsePeer;
|
||||
|
||||
|
||||
/// Not for serde
|
||||
pub fn deserialize_20_bytes(value: &str) -> anyhow::Result<[u8; 20]> {
|
||||
pub fn deserialize_20_bytes(value: SmartString<LazyCompact>) -> anyhow::Result<[u8; 20]> {
|
||||
let mut arr = [0u8; 20];
|
||||
let mut char_iter = value.chars();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue