Zero-alloc trie lookups (#3998)

* triedb cleanup

* factor out common portion of trie query

* allocate far fewer times in node decoding

* fix bench compilation

* introduce OwnedNode variant to make iter fast again

* generalize recorder trait to Query

* decode trie outputs cost-free in state

* test for passing closure as query
This commit is contained in:
Robert Habermeier
2017-01-06 16:18:45 +01:00
committed by Gav Wood
parent e983339edd
commit 9c00eb4e8a
13 changed files with 395 additions and 382 deletions

View File

@@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
//! benchmarking for rlp
//! benchmarking for bigint
//! should be started with:
//! ```bash
//! multirust run nightly cargo bench
@@ -24,10 +24,10 @@
#![feature(asm)]
extern crate test;
extern crate ethcore_bigint as bigint;
extern crate ethcore_util;
use test::{Bencher, black_box};
use bigint::uint::{U256, U512, Uint, U128};
use ethcore_util::{U256, U512, Uint, U128};
#[bench]
fn u256_add(b: &mut Bencher) {

View File

@@ -24,12 +24,12 @@
extern crate test;
extern crate rlp;
extern crate ethcore_bigint as bigint;
extern crate ethcore_util as util;
use test::Bencher;
use std::str::FromStr;
use rlp::*;
use bigint::uint::U256;
use util::U256;
#[bench]
fn bench_stream_u64_value(b: &mut Bencher) {