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

Added Tombstones #12

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
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
13 changes: 13 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Compiled files
*.o
*.so
*.rlib
*.dll

# Executables
*.exe

# Generated by Cargo
/target/
Cargo.lock

2 changes: 0 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ description = "A hash table with consistent order and fast iteration."
[lib]
bench = false

[dependencies]

[dev-dependencies]
itertools = "0.5.1"
rand = "0.3"
Expand Down
33 changes: 33 additions & 0 deletions benches/bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -610,3 +610,36 @@ fn retain_many_ordermap_100_000(b: &mut Bencher) {
map
});
}

#[bench]
fn remove_index_tombstones_many_ordermap_100_000(b: &mut Bencher) {
let mut map = OMAP_100K.clone();
map.retain(|k, _| *k % 7 == 0);

b.iter(|| {
let mut map = map.clone();
map.remove_index_tombstones()
});
}

#[bench]
fn remove_index_tombstones_half_ordermap_100_000(b: &mut Bencher) {
let mut map = OMAP_100K.clone();
map.retain(|k, _| *k % 2 == 0);

b.iter(|| {
let mut map = map.clone();
map.remove_index_tombstones()
});
}

#[bench]
fn remove_index_tombstones_some_ordermap_100_000(b: &mut Bencher) {
let mut map = OMAP_100K.clone();
map.retain(|k, _| *k % 100 == 0);

b.iter(|| {
let mut map = map.clone();
map.remove_index_tombstones()
});
}
Loading