Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

[blooms-db] Fix benchmarks #10974

Merged
merged 2 commits into from
Aug 15, 2019
Merged
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
16 changes: 8 additions & 8 deletions util/blooms-db/benches/blooms.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ use ethbloom::Bloom;
fn blooms_filter_1_million_ok(b: &mut Bencher) {
let tempdir = TempDir::new("").unwrap();
let database = Database::open(tempdir.path()).unwrap();
database.insert_blooms(999_999, iter::once(&Bloom::from(0))).unwrap();
let bloom = Bloom::from(0x001);
database.insert_blooms(999_999, iter::once(&Bloom::zero())).unwrap();
let bloom = Bloom::from_low_u64_be(0x001);
database.insert_blooms(200_000, iter::once(&bloom)).unwrap();
database.insert_blooms(400_000, iter::once(&bloom)).unwrap();
database.insert_blooms(600_000, iter::once(&bloom)).unwrap();
Expand All @@ -48,9 +48,9 @@ fn blooms_filter_1_million_ok(b: &mut Bencher) {
fn blooms_filter_1_million_miss(b: &mut Bencher) {
let tempdir = TempDir::new("").unwrap();
let database = Database::open(tempdir.path()).unwrap();
database.insert_blooms(999_999, iter::once(&Bloom::from(0))).unwrap();
let bloom = Bloom::from(0x001);
let bad_bloom = Bloom::from(0x0001);
database.insert_blooms(999_999, iter::once(&Bloom::zero())).unwrap();
let bloom = Bloom::from_low_u64_be(0x001);
let bad_bloom = Bloom::from_low_u64_be(0x0001);
database.insert_blooms(200_000, iter::once(&bloom)).unwrap();
database.insert_blooms(400_000, iter::once(&bloom)).unwrap();
database.insert_blooms(600_000, iter::once(&bloom)).unwrap();
Expand All @@ -66,9 +66,9 @@ fn blooms_filter_1_million_miss(b: &mut Bencher) {
fn blooms_filter_1_million_miss_and_ok(b: &mut Bencher) {
let tempdir = TempDir::new("").unwrap();
let database = Database::open(tempdir.path()).unwrap();
database.insert_blooms(999_999, iter::once(&Bloom::from(0))).unwrap();
let bloom = Bloom::from(0x001);
let bad_bloom = Bloom::from(0x0001);
database.insert_blooms(999_999, iter::once(&Bloom::zero())).unwrap();
let bloom = Bloom::from_low_u64_be(0x001);
let bad_bloom = Bloom::from_low_u64_be(0x0001);
database.insert_blooms(200_000, iter::once(&bloom)).unwrap();
database.insert_blooms(400_000, iter::once(&bloom)).unwrap();
database.insert_blooms(600_000, iter::once(&bloom)).unwrap();
Expand Down
2 changes: 1 addition & 1 deletion util/blooms-db/src/db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use std::path::{Path, PathBuf};
use ethbloom;
use crate::file::{File, FileIterator};

fn other_io_err<E>(e: E) -> io::Error where E: Into<Box<error::Error + Send + Sync>> {
fn other_io_err<E>(e: E) -> io::Error where E: Into<Box<dyn error::Error + Send + Sync>> {
io::Error::new(io::ErrorKind::Other, e)
}

Expand Down