rlp deserialization refactor, 30% faster (#4901)

* fixed naming of rlp modules

* RlpStream cleanup

* appending short rlp lists (0...55 bytes) is 25% faster

* RlpStream does not use bytes module, nor trait Stream

* removed unused code from rlp module

* compiling ethcore-util with new rlp serialization

* compiling parity with new rlp serialization

* fixed compiling ethcore-light with new rlp serialization

* fixed compiling ethsync with new rlp serialization

* moved rlp benches and rlp tests

* rlp deserialization refactor, 30% faster

* removed redundant comment, print

* fixed compiling parity with new rlp deserialization

* removed redundant double-space

* fixed failing test

* updated rlp docs, removed unused traits

* fixed rlp benchmarks

* replace usage of WriteBytesExt with ByteOrder

* removed unused, commented out code

* fixed merge conflict
This commit is contained in:
Marek Kotewicz
2017-03-22 14:41:46 +01:00
committed by GitHub
parent b6f9cf4ba7
commit 044d070667
71 changed files with 618 additions and 834 deletions

View File

@@ -20,7 +20,7 @@ use util::*;
use header::*;
use transaction::*;
use super::{TransactionView, HeaderView};
use rlp::{Rlp, View};
use rlp::Rlp;
/// View onto block rlp.
pub struct BlockView<'a> {
@@ -69,7 +69,7 @@ impl<'a> BlockView<'a> {
/// Return List of transactions in given block.
pub fn transactions(&self) -> Vec<UnverifiedTransaction> {
self.rlp.val_at(1)
self.rlp.list_at(1)
}
/// Return List of transactions with additional localization info.
@@ -125,7 +125,7 @@ impl<'a> BlockView<'a> {
/// Return list of uncles of given block.
pub fn uncles(&self) -> Vec<Header> {
self.rlp.val_at(2)
self.rlp.list_at(2)
}
/// Return number of uncles in given block, without deserializing them.

View File

@@ -20,7 +20,7 @@ use util::*;
use header::*;
use transaction::*;
use super::{TransactionView, HeaderView};
use rlp::{Rlp, View};
use rlp::Rlp;
/// View onto block rlp.
pub struct BodyView<'a> {
@@ -49,7 +49,7 @@ impl<'a> BodyView<'a> {
/// Return List of transactions in given block.
pub fn transactions(&self) -> Vec<UnverifiedTransaction> {
self.rlp.val_at(0)
self.rlp.list_at(0)
}
/// Return List of transactions with additional localization info.
@@ -99,7 +99,7 @@ impl<'a> BodyView<'a> {
/// Return list of uncles of given block.
pub fn uncles(&self) -> Vec<Header> {
self.rlp.val_at(1)
self.rlp.list_at(1)
}
/// Return number of uncles in given block, without deserializing them.

View File

@@ -17,7 +17,7 @@
//! View onto block header rlp
use util::{U256, Bytes, Hashable, H256, Address, H2048};
use rlp::{Rlp, View};
use rlp::Rlp;
use header::BlockNumber;
/// View onto block header rlp.

View File

@@ -16,7 +16,7 @@
//! View onto transaction rlp
use util::{U256, Bytes, Hashable, H256};
use rlp::{Rlp, View};
use rlp::Rlp;
/// View onto transaction rlp.
pub struct TransactionView<'a> {