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:
Greg Fitzgerald 2019-08-12 16:46:49 -06:00 committed by GitHub
parent 687818aad6
commit a43922ccbf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 5 additions and 25 deletions

11
Cargo.lock generated
View File

@ -1244,11 +1244,6 @@ dependencies = [
"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]]
name = "heck"
version = "0.3.1"
@ -3048,7 +3043,6 @@ dependencies = [
"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)",
"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)",
"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)",
@ -3357,7 +3351,6 @@ version = "0.18.0-pre1"
dependencies = [
"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)",
"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_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)",
@ -3374,7 +3367,6 @@ dependencies = [
name = "solana-genesis-programs"
version = "0.18.0-pre1"
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-program 0.18.0-pre1",
"solana-budget-api 0.18.0-pre1",
@ -3501,7 +3493,6 @@ dependencies = [
name = "solana-local-cluster"
version = "0.18.0-pre1"
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)",
"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)",
@ -3636,7 +3627,6 @@ dependencies = [
"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)",
"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)",
"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)",
@ -5341,7 +5331,6 @@ dependencies = [
"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 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 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"

View File

@ -28,7 +28,6 @@ crossbeam-channel = "0.3"
dir-diff = "0.3.1"
flate2 = "1.0.9"
fs_extra = "1.1.0"
hashbrown = "0.5.0"
indexmap = "1.0"
itertools = "0.8.0"
jsonrpc-core = "13.0.0"

View File

@ -8,7 +8,6 @@ use crate::consensus::VOTE_THRESHOLD_DEPTH;
use crate::contact_info::ContactInfo;
use crate::entry::{Entry, EntrySlice};
use crate::gossip_service::discover_cluster;
use hashbrown::HashSet;
use solana_client::thin_client::create_client;
use solana_runtime::epoch_schedule::MINIMUM_SLOTS_PER_EPOCH;
use solana_sdk::client::SyncClient;
@ -22,6 +21,7 @@ use solana_sdk::timing::{
NUM_CONSECUTIVE_LEADER_SLOTS,
};
use solana_sdk::transport::TransportError;
use std::collections::HashSet;
use std::path::Path;
use std::thread::sleep;
use std::time::Duration;

View File

@ -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-vote-api = { path = "../programs/vote_api", version = "0.18.0-pre1" }
[dev-dependencies]
hashbrown = "0.5.0"
[features]
cuda = ["solana/cuda"]

View File

@ -9,7 +9,6 @@ homepage = "https://solana.com/"
edition = "2018"
[dependencies]
hashbrown = "0.5.0"
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-budget-api= { path = "../programs/budget_api", version = "0.18.0-pre0" }

View File

@ -35,7 +35,7 @@ pub fn get() -> Vec<(String, Pubkey)> {
#[cfg(test)]
mod tests {
use hashbrown::HashSet;
use std::collections::HashSet;
#[test]
fn test_id_uniqueness() {

View File

@ -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" }
[dev-dependencies]
hashbrown = "0.5.0"
serial_test = "0.2.0"
serial_test_derive = "0.2.0"

View File

@ -1,6 +1,5 @@
extern crate solana;
use hashbrown::HashSet;
use log::*;
use serial_test_derive::serial;
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::poh_config::PohConfig;
use solana_sdk::timing;
use std::collections::HashSet;
use std::thread::sleep;
use std::time::Duration;

View File

@ -14,7 +14,6 @@ bv = { version = "0.11.0", features = ["serde"] }
byteorder = "1.3.2"
fnv = "1.0.6"
fs_extra = "1.1.0"
hashbrown = "0.5.0"
lazy_static = "1.3.0"
libc = "0.2.61"
libloading = "0.5.2"

View File

@ -6,8 +6,7 @@ use fnv::FnvHasher;
use solana_runtime::bloom::{Bloom, BloomHashIndex};
use solana_sdk::hash::{hash, Hash};
use solana_sdk::signature::Signature;
//use std::collections::HashSet;
use hashbrown::HashSet;
use std::collections::HashSet;
use std::hash::Hasher;
use test::Bencher;

View File

@ -7,7 +7,7 @@ type ForkList<T> = Vec<(Fork, T)>;
#[derive(Debug, Default)]
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>,