Skip to content
New issue

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

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

Already on GitHub? # to your account

Fix compilation and running of command and deserialization benchmarks #511

Merged
merged 4 commits into from
Sep 17, 2020
Merged
Changes from 1 commit
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
5 changes: 3 additions & 2 deletions command-parser/benches/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use patricia_tree::PatriciaSet;
use std::{
borrow::Cow,
collections::{BTreeSet, HashSet},
iter::FromIterator,
};

fn btreeset(set: &BTreeSet<Cow<'static, str>>, needle: &str) {
Expand Down Expand Up @@ -77,7 +78,7 @@ fn criterion_benchmark(c: &mut Criterion) {
];

c.bench_function("c: btreeset", |b| {
let mut set = BTreeSet::from_iter(commands.iter().map(Cow::from));
let set = BTreeSet::from_iter(commands.iter().map(|e| Cow::from(*e)));

b.iter(|| {
for command in commands.iter() {
Expand All @@ -87,7 +88,7 @@ fn criterion_benchmark(c: &mut Criterion) {
});

c.bench_function("c: hashset", |b| {
let mut set = HashSet::from_iter(commands.iter().map(Cow::from));
let set = HashSet::from_iter(commands.iter().map(|e| Cow::from(*e)));

for e in commands.iter() {
set.insert(Cow::from(*e));
Expand Down