switch network/protocol to hashbrown (5% perf increase)

This commit is contained in:
Marcel Märtens 2021-04-29 19:12:57 +02:00
parent 653fb065e0
commit 1ead240ad2
4 changed files with 6 additions and 8 deletions

1
Cargo.lock generated
View File

@ -5670,6 +5670,7 @@ dependencies = [
"bitflags", "bitflags",
"bytes", "bytes",
"criterion", "criterion",
"hashbrown",
"prometheus", "prometheus",
"rand 0.8.3", "rand 0.8.3",
"tokio", "tokio",

View File

@ -24,6 +24,7 @@ rand = { version = "0.8" }
# async traits # async traits
async-trait = "0.1.42" async-trait = "0.1.42"
bytes = "^1" bytes = "^1"
hashbrown = { version = ">=0.9, <0.12" }
[dev-dependencies] [dev-dependencies]
async-channel = "1.5.1" async-channel = "1.5.1"

View File

@ -12,10 +12,8 @@ use crate::{
}; };
use async_trait::async_trait; use async_trait::async_trait;
use bytes::BytesMut; use bytes::BytesMut;
use std::{ use hashbrown::HashMap;
collections::HashMap, use std::time::{Duration, Instant};
time::{Duration, Instant},
};
use tracing::info; use tracing::info;
#[cfg(feature = "trace_pedantic")] #[cfg(feature = "trace_pedantic")]
use tracing::trace; use tracing::trace;

View File

@ -11,10 +11,8 @@ use crate::{
}; };
use async_trait::async_trait; use async_trait::async_trait;
use bytes::BytesMut; use bytes::BytesMut;
use std::{ use hashbrown::HashMap;
collections::HashMap, use std::time::{Duration, Instant};
time::{Duration, Instant},
};
use tracing::info; use tracing::info;
#[cfg(feature = "trace_pedantic")] #[cfg(feature = "trace_pedantic")]
use tracing::trace; use tracing::trace;