bsc/rlp
Felix Lange 7194c847b6
p2p/rlpx: reduce allocation and syscalls (#22899)
This change significantly improves the performance of RLPx message reads
and writes. In the previous implementation, reading and writing of
message frames performed multiple reads and writes on the underlying
network connection, and allocated a new []byte buffer for every read.

In the new implementation, reads and writes re-use buffers, and perform
much fewer system calls on the underlying connection. This doubles the
theoretically achievable throughput on a single connection, as shown by
the benchmark result:

    name             old speed      new speed       delta
    Throughput-8     70.3MB/s ± 0%  155.4MB/s ± 0%  +121.11%  (p=0.000 n=9+8)

The change also removes support for the legacy, pre-EIP-8 handshake encoding.
As of May 2021, no actively maintained client sends this format.
2021-05-27 10:19:13 +02:00
..
decode_tail_test.go all: update license information 2016-04-15 09:48:05 +02:00
decode_test.go rlp: optimize big.Int decoding for size <= 32 bytes (#22927) 2021-05-25 21:56:25 +02:00
decode.go rlp: optimize big.Int decoding for size <= 32 bytes (#22927) 2021-05-25 21:56:25 +02:00
doc.go rlp: add support for optional struct fields (#22832) 2021-05-07 14:37:13 +02:00
encode_test.go rlp: optimize big.Int decoding for size <= 32 bytes (#22927) 2021-05-25 21:56:25 +02:00
encode.go rlp: optimize byte array handling (#22924) 2021-05-22 15:10:16 +02:00
encoder_example_test.go rlp: improve nil pointer handling (#20064) 2019-09-13 11:10:57 +02:00
iterator_test.go cmd, core, eth: background transaction indexing (#20302) 2020-05-11 18:58:43 +03:00
iterator.go core/rawdb: fix transaction indexing/unindexing hashing error (#22457) 2021-03-16 12:15:14 +02:00
raw_test.go p2p/rlpx: reduce allocation and syscalls (#22899) 2021-05-27 10:19:13 +02:00
raw.go p2p/rlpx: reduce allocation and syscalls (#22899) 2021-05-27 10:19:13 +02:00
safe.go rlp, tests/fuzzers/bls12381: gofmt (#22937) 2021-05-25 10:14:39 +02:00
typecache.go rlp: use atomic.Value for type cache (#22902) 2021-05-22 13:34:29 +02:00
unsafe.go rlp: optimize byte array handling (#22924) 2021-05-22 15:10:16 +02:00