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

@@ -24,7 +24,7 @@ use ethcore::receipt::Receipt;
use io::TimerToken;
use network::{NetworkProtocolHandler, NetworkContext, PeerId};
use rlp::{RlpStream, UntrustedRlp, View};
use rlp::{RlpStream, UntrustedRlp};
use util::hash::H256;
use util::{Bytes, DBValue, Mutex, RwLock, U256};
use time::{Duration, SteadyTime};
@@ -953,7 +953,7 @@ impl LightProtocol {
let id_guard = self.pre_verify_response(peer, request::Kind::Receipts, &raw)?;
let raw_receipts: Vec<Vec<Receipt>> = raw.at(2)?
.iter()
.map(|x| x.as_val())
.map(|x| x.as_list())
.collect::<Result<_,_>>()?;
let req_id = id_guard.defuse();