Boot hashbrown (#5505)
As of Rust 1.36.0, hashbrown now implements the HashMap in std (which implements HashSet). https://blog.rust-lang.org/2019/07/04/Rust-1.36.0.html#a-new-hashmapk,-v%3E-implementation
This commit is contained in:
parent
687818aad6
commit
a43922ccbf
|
@ -1244,11 +1244,6 @@ dependencies = [
|
||||||
"scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
"scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "hashbrown"
|
|
||||||
version = "0.5.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "heck"
|
name = "heck"
|
||||||
version = "0.3.1"
|
version = "0.3.1"
|
||||||
|
@ -3048,7 +3043,6 @@ dependencies = [
|
||||||
"dir-diff 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"dir-diff 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"flate2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)",
|
"flate2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"fs_extra 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"fs_extra 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"hashbrown 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
||||||
"hex-literal 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"hex-literal 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"indexmap 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
"indexmap 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"itertools 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"itertools 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
@ -3357,7 +3351,6 @@ version = "0.18.0-pre1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bincode 1.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
"bincode 1.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"hashbrown 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
||||||
"serde 1.0.98 (registry+https://github.com/rust-lang/crates.io-index)",
|
"serde 1.0.98 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"serde_derive 1.0.98 (registry+https://github.com/rust-lang/crates.io-index)",
|
"serde_derive 1.0.98 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"serde_json 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)",
|
"serde_json 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
@ -3374,7 +3367,6 @@ dependencies = [
|
||||||
name = "solana-genesis-programs"
|
name = "solana-genesis-programs"
|
||||||
version = "0.18.0-pre1"
|
version = "0.18.0-pre1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"hashbrown 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
||||||
"solana-bpf-loader-api 0.18.0-pre1",
|
"solana-bpf-loader-api 0.18.0-pre1",
|
||||||
"solana-bpf-loader-program 0.18.0-pre1",
|
"solana-bpf-loader-program 0.18.0-pre1",
|
||||||
"solana-budget-api 0.18.0-pre1",
|
"solana-budget-api 0.18.0-pre1",
|
||||||
|
@ -3501,7 +3493,6 @@ dependencies = [
|
||||||
name = "solana-local-cluster"
|
name = "solana-local-cluster"
|
||||||
version = "0.18.0-pre1"
|
version = "0.18.0-pre1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"hashbrown 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
||||||
"log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
"log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"serial_test 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"serial_test 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"serial_test_derive 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"serial_test_derive 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
@ -3636,7 +3627,6 @@ dependencies = [
|
||||||
"byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
"byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
"fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"fs_extra 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"fs_extra 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"hashbrown 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
||||||
"lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"libc 0.2.61 (registry+https://github.com/rust-lang/crates.io-index)",
|
"libc 0.2.61 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"libloading 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
"libloading 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
@ -5341,7 +5331,6 @@ dependencies = [
|
||||||
"checksum h2 0.1.26 (registry+https://github.com/rust-lang/crates.io-index)" = "a5b34c246847f938a410a03c5458c7fee2274436675e76d8b903c08efc29c462"
|
"checksum h2 0.1.26 (registry+https://github.com/rust-lang/crates.io-index)" = "a5b34c246847f938a410a03c5458c7fee2274436675e76d8b903c08efc29c462"
|
||||||
"checksum hash32 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "12d790435639c06a7b798af9e1e331ae245b7ef915b92f70a39b4cf8c00686af"
|
"checksum hash32 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "12d790435639c06a7b798af9e1e331ae245b7ef915b92f70a39b4cf8c00686af"
|
||||||
"checksum hashbrown 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "3bae29b6653b3412c2e71e9d486db9f9df5d701941d86683005efb9f2d28e3da"
|
"checksum hashbrown 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "3bae29b6653b3412c2e71e9d486db9f9df5d701941d86683005efb9f2d28e3da"
|
||||||
"checksum hashbrown 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e1de41fb8dba9714efd92241565cdff73f78508c95697dd56787d3cba27e2353"
|
|
||||||
"checksum heck 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "20564e78d53d2bb135c343b3f47714a56af2061f1c928fdb541dc7b9fdd94205"
|
"checksum heck 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "20564e78d53d2bb135c343b3f47714a56af2061f1c928fdb541dc7b9fdd94205"
|
||||||
"checksum hex 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "805026a5d0141ffc30abb3be3173848ad46a1b1664fe632428479619a3644d77"
|
"checksum hex 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "805026a5d0141ffc30abb3be3173848ad46a1b1664fe632428479619a3644d77"
|
||||||
"checksum hex-literal 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c3da68162fdd2147e66682e78e729bd77f93b4c99656db058c5782d8c6b6225a"
|
"checksum hex-literal 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c3da68162fdd2147e66682e78e729bd77f93b4c99656db058c5782d8c6b6225a"
|
||||||
|
|
|
@ -28,7 +28,6 @@ crossbeam-channel = "0.3"
|
||||||
dir-diff = "0.3.1"
|
dir-diff = "0.3.1"
|
||||||
flate2 = "1.0.9"
|
flate2 = "1.0.9"
|
||||||
fs_extra = "1.1.0"
|
fs_extra = "1.1.0"
|
||||||
hashbrown = "0.5.0"
|
|
||||||
indexmap = "1.0"
|
indexmap = "1.0"
|
||||||
itertools = "0.8.0"
|
itertools = "0.8.0"
|
||||||
jsonrpc-core = "13.0.0"
|
jsonrpc-core = "13.0.0"
|
||||||
|
|
|
@ -8,7 +8,6 @@ use crate::consensus::VOTE_THRESHOLD_DEPTH;
|
||||||
use crate::contact_info::ContactInfo;
|
use crate::contact_info::ContactInfo;
|
||||||
use crate::entry::{Entry, EntrySlice};
|
use crate::entry::{Entry, EntrySlice};
|
||||||
use crate::gossip_service::discover_cluster;
|
use crate::gossip_service::discover_cluster;
|
||||||
use hashbrown::HashSet;
|
|
||||||
use solana_client::thin_client::create_client;
|
use solana_client::thin_client::create_client;
|
||||||
use solana_runtime::epoch_schedule::MINIMUM_SLOTS_PER_EPOCH;
|
use solana_runtime::epoch_schedule::MINIMUM_SLOTS_PER_EPOCH;
|
||||||
use solana_sdk::client::SyncClient;
|
use solana_sdk::client::SyncClient;
|
||||||
|
@ -22,6 +21,7 @@ use solana_sdk::timing::{
|
||||||
NUM_CONSECUTIVE_LEADER_SLOTS,
|
NUM_CONSECUTIVE_LEADER_SLOTS,
|
||||||
};
|
};
|
||||||
use solana_sdk::transport::TransportError;
|
use solana_sdk::transport::TransportError;
|
||||||
|
use std::collections::HashSet;
|
||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
use std::thread::sleep;
|
use std::thread::sleep;
|
||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
|
|
|
@ -22,10 +22,6 @@ solana-stake-api = { path = "../programs/stake_api", version = "0.18.0-pre1" }
|
||||||
solana-storage-api = { path = "../programs/storage_api", version = "0.18.0-pre1" }
|
solana-storage-api = { path = "../programs/storage_api", version = "0.18.0-pre1" }
|
||||||
solana-vote-api = { path = "../programs/vote_api", version = "0.18.0-pre1" }
|
solana-vote-api = { path = "../programs/vote_api", version = "0.18.0-pre1" }
|
||||||
|
|
||||||
[dev-dependencies]
|
|
||||||
hashbrown = "0.5.0"
|
|
||||||
|
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
cuda = ["solana/cuda"]
|
cuda = ["solana/cuda"]
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,6 @@ homepage = "https://solana.com/"
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
hashbrown = "0.5.0"
|
|
||||||
solana-bpf-loader-api = { path = "../programs/bpf_loader_api", version = "0.18.0-pre1" }
|
solana-bpf-loader-api = { path = "../programs/bpf_loader_api", version = "0.18.0-pre1" }
|
||||||
solana-bpf-loader-program = { path = "../programs/bpf_loader_program", version = "0.18.0-pre1" }
|
solana-bpf-loader-program = { path = "../programs/bpf_loader_program", version = "0.18.0-pre1" }
|
||||||
solana-budget-api= { path = "../programs/budget_api", version = "0.18.0-pre0" }
|
solana-budget-api= { path = "../programs/budget_api", version = "0.18.0-pre0" }
|
||||||
|
|
|
@ -35,7 +35,7 @@ pub fn get() -> Vec<(String, Pubkey)> {
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use hashbrown::HashSet;
|
use std::collections::HashSet;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_id_uniqueness() {
|
fn test_id_uniqueness() {
|
||||||
|
|
|
@ -21,7 +21,6 @@ solana-storage-program = { path = "../programs/storage_program", version = "0.18
|
||||||
solana-vote-api = { path = "../programs/vote_api", version = "0.18.0-pre1" }
|
solana-vote-api = { path = "../programs/vote_api", version = "0.18.0-pre1" }
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
hashbrown = "0.5.0"
|
|
||||||
serial_test = "0.2.0"
|
serial_test = "0.2.0"
|
||||||
serial_test_derive = "0.2.0"
|
serial_test_derive = "0.2.0"
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
extern crate solana;
|
extern crate solana;
|
||||||
|
|
||||||
use hashbrown::HashSet;
|
|
||||||
use log::*;
|
use log::*;
|
||||||
use serial_test_derive::serial;
|
use serial_test_derive::serial;
|
||||||
use solana::blocktree::Blocktree;
|
use solana::blocktree::Blocktree;
|
||||||
|
@ -14,6 +13,7 @@ use solana_runtime::epoch_schedule::{EpochSchedule, MINIMUM_SLOTS_PER_EPOCH};
|
||||||
use solana_sdk::client::SyncClient;
|
use solana_sdk::client::SyncClient;
|
||||||
use solana_sdk::poh_config::PohConfig;
|
use solana_sdk::poh_config::PohConfig;
|
||||||
use solana_sdk::timing;
|
use solana_sdk::timing;
|
||||||
|
use std::collections::HashSet;
|
||||||
use std::thread::sleep;
|
use std::thread::sleep;
|
||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,6 @@ bv = { version = "0.11.0", features = ["serde"] }
|
||||||
byteorder = "1.3.2"
|
byteorder = "1.3.2"
|
||||||
fnv = "1.0.6"
|
fnv = "1.0.6"
|
||||||
fs_extra = "1.1.0"
|
fs_extra = "1.1.0"
|
||||||
hashbrown = "0.5.0"
|
|
||||||
lazy_static = "1.3.0"
|
lazy_static = "1.3.0"
|
||||||
libc = "0.2.61"
|
libc = "0.2.61"
|
||||||
libloading = "0.5.2"
|
libloading = "0.5.2"
|
||||||
|
|
|
@ -6,8 +6,7 @@ use fnv::FnvHasher;
|
||||||
use solana_runtime::bloom::{Bloom, BloomHashIndex};
|
use solana_runtime::bloom::{Bloom, BloomHashIndex};
|
||||||
use solana_sdk::hash::{hash, Hash};
|
use solana_sdk::hash::{hash, Hash};
|
||||||
use solana_sdk::signature::Signature;
|
use solana_sdk::signature::Signature;
|
||||||
//use std::collections::HashSet;
|
use std::collections::HashSet;
|
||||||
use hashbrown::HashSet;
|
|
||||||
use std::hash::Hasher;
|
use std::hash::Hasher;
|
||||||
use test::Bencher;
|
use test::Bencher;
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@ type ForkList<T> = Vec<(Fork, T)>;
|
||||||
|
|
||||||
#[derive(Debug, Default)]
|
#[derive(Debug, Default)]
|
||||||
pub struct AccountsIndex<T> {
|
pub struct AccountsIndex<T> {
|
||||||
pub account_maps: hashbrown::HashMap<Pubkey, RwLock<ForkList<T>>>,
|
pub account_maps: HashMap<Pubkey, RwLock<ForkList<T>>>,
|
||||||
|
|
||||||
pub roots: HashSet<Fork>,
|
pub roots: HashSet<Fork>,
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue