Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removal of smallvec from dependancies. #1974

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 0 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ regex = "1.3.4"
resolv-conf = "0.7.0"
rusqlite = "0.29.0"
serde = "1.0"
smallvec = "1.6"
socket2 = "0.5"
time = "0.3"
tinyvec = "1.1.1"
Expand Down
1 change: 0 additions & 1 deletion crates/proto/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ ring = { workspace = true, optional = true, features = ["std"] }
rustls = { workspace = true, optional = true }
rustls-pemfile = { workspace = true, optional = true }
serde = { workspace = true, features = ["derive"], optional = true }
smallvec.workspace = true
socket2 = { workspace = true, optional = true }
thiserror.workspace = true
tinyvec = { workspace = true, features = ["alloc"] }
Expand Down
2 changes: 1 addition & 1 deletion crates/proto/src/serialize/binary/encoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ mod private {
pub struct BinEncoder<'a> {
offset: usize,
buffer: private::MaximalBuf<'a>,
/// start of label pointers with their labels in fully decompressed form for easy comparison, smallvec here?
/// start of label pointers with their labels in fully decompressed form for easy comparison, tinyvec here?
name_pointers: Vec<(usize, Vec<u8>)>,
mode: EncodeMode,
canonical_names: bool,
Expand Down
2 changes: 1 addition & 1 deletion crates/proto/src/xfer/dns_request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ pub struct DnsRequestOptions {
#[deprecated]
pub expects_multiple_responses: bool,
// /// If set, then the request will terminate early if all types have been received
// pub expected_record_types: Option<SmallVec<[RecordType; 2]>>,
// pub expected_record_types: Option<TinyVec<[RecordType; 2]>>,
// TODO: add EDNS options here?
/// When true, will add EDNS options to the request.
pub use_edns: bool,
Expand Down
1 change: 0 additions & 1 deletion crates/resolver/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ rand.workspace = true
resolv-conf = { workspace = true, optional = true, features = ["system"] }
rustls = { workspace = true, optional = true }
serde = { workspace = true, features = ["derive"], optional = true }
smallvec.workspace = true
thiserror.workspace = true
tracing.workspace = true
tokio = { workspace = true, optional = true }
Expand Down
2 changes: 1 addition & 1 deletion crates/resolver/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ impl<'de> DeserializeT<'de> for NameServerConfigGroup {
impl NameServerConfigGroup {
/// Creates a new `NameServerConfigGroup` with a default size of 2
pub fn new() -> Self {
// this might be a nice opportunity for SmallVec
// this might be a nice opportunity for TinyVec
// most name_server configs will be 2.
Self::with_capacity(2)
}
Expand Down
5 changes: 2 additions & 3 deletions crates/resolver/src/name_server/name_server_pool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ use std::time::Duration;

use futures_util::future::FutureExt;
use futures_util::stream::{once, FuturesUnordered, Stream, StreamExt};
use smallvec::SmallVec;

use proto::xfer::{DnsHandle, DnsRequest, DnsResponse, FirstAnswer};
use proto::Time;
Expand Down Expand Up @@ -320,13 +319,13 @@ where
// close to the connection, which means the top level resolution might take substantially longer
// to fire than the timeout configured in `ResolverOpts`.
let mut backoff = Duration::from_millis(20);
let mut busy = SmallVec::<[NameServer<P>; 2]>::new();
let mut busy = Vec::<NameServer<P>>::with_capacity(2);

loop {
let request_cont = request.clone();

// construct the parallel requests, 2 is the default
let mut par_conns = SmallVec::<[NameServer<P>; 2]>::new();
let mut par_conns = Vec::<NameServer<P>>::with_capacity(2);
let count = conns.len().min(opts.num_concurrent_reqs.max(1));

// Shuffe DNS NameServers to avoid overloads to the first configured ones
Expand Down