Skip to content

Remove hashbrown and arrayvec #11

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

Merged
merged 1 commit into from
Sep 3, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -42,15 +42,8 @@ itertools = "=0.8.0"
# 高速なハッシュ関数
rustc-hash = "=1.0.1"

# 高速なHashMap
# Rust 1.36.0からは標準ライブラリのHashMapがこれに置き換わる。(AtCoder 2019年言語
# アップデートではそれより古い1.35.0を採用) ハッシュ関数として従来のSipHashが用いられる
# ことに注意。(SipHashは暗号強度を持つため計算量が多く低速)
hashbrown = "=0.5.0"

# 固定配列上のベクタ。ヒープ領域でなくスタック領域にアロケートされるので高速かもしれない
smallvec = "=0.6.10"
arrayvec = "=0.4.11"

# 標準ライブラリのVecやHashMapに対応する永続データ構造
# 永続データ構造は関数型言語によく見られるデータ構造で、要素を更新しても、そのデータ構造の
21 changes: 0 additions & 21 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -12,9 +12,7 @@ fn main() -> UnitResult {
run_superslice();
run_itertools();
run_rustc_hash();
run_hashbrown();
// run_smallvec();
// run_arrayvec();
// run_im_rc();
// run_num();
run_rand_family()?;
@@ -359,26 +357,7 @@ fn test_rustc_hash() {
run_rustc_hash();
}

// hashbrown
fn run_hashbrown() {
use hashbrown::HashMap;

let mut map = [('c', "Cindy"), ('a', "Alice"), ('b', "Bob")]
.iter()
.map(|(c, s)| (*c, s.to_string()))
.collect::<HashMap<_, _>>();
map.entry('d').or_insert("Denis".to_string());
map.insert('a', "Alexa".to_string());
assert_eq!(map.len(), 4);
}

#[test]
fn test_hashbrown() {
run_hashbrown();
}

// smallvec
// arrayvec

// im-rc