fixed benches

This commit is contained in:
debris 2015-12-10 15:57:47 +01:00
parent 4210b957ac
commit 8c9fe2fbe5

View File

@ -10,6 +10,8 @@ use test::Bencher;
use ethcore_util::hash::*; use ethcore_util::hash::*;
use ethcore_util::bytes::*; use ethcore_util::bytes::*;
use ethcore_util::trie::*; use ethcore_util::trie::*;
use ethcore_util::hashdb::*;
use ethcore_util::memorydb::*;
use ethcore_util::triehash::*; use ethcore_util::triehash::*;
use ethcore_util::sha3::*; use ethcore_util::sha3::*;
@ -51,7 +53,8 @@ fn trie_insertions_six_high(b: &mut Bencher) {
} }
b.iter(||{ b.iter(||{
let mut t = TrieDB::new_memory(); let mut memdb = MemoryDB::new();
let mut t = TrieDB::new(&mut memdb);
for i in d.iter() { for i in d.iter() {
t.insert(&i.0, &i.1); t.insert(&i.0, &i.1);
} }
@ -84,7 +87,8 @@ fn trie_insertions_six_mid(b: &mut Bencher) {
d.push((k, v)) d.push((k, v))
} }
b.iter(||{ b.iter(||{
let mut t = TrieDB::new_memory(); let mut memdb = MemoryDB::new();
let mut t = TrieDB::new(&mut memdb);
for i in d.iter() { for i in d.iter() {
t.insert(&i.0, &i.1); t.insert(&i.0, &i.1);
} }
@ -119,7 +123,8 @@ fn trie_insertions_random_mid(b: &mut Bencher) {
} }
b.iter(||{ b.iter(||{
let mut t = TrieDB::new_memory(); let mut memdb = MemoryDB::new();
let mut t = TrieDB::new(&mut memdb);
for i in d.iter() { for i in d.iter() {
t.insert(&i.0, &i.1); t.insert(&i.0, &i.1);
} }
@ -154,7 +159,8 @@ fn trie_insertions_six_low(b: &mut Bencher) {
} }
b.iter(||{ b.iter(||{
let mut t = TrieDB::new_memory(); let mut memdb = MemoryDB::new();
let mut t = TrieDB::new(&mut memdb);
for i in d.iter() { for i in d.iter() {
t.insert(&i.0, &i.1); t.insert(&i.0, &i.1);
} }