go-ethereum/rlp
Qian Bin 65ed1a6871
rlp, trie: faster trie node encoding (#24126)
This change speeds up trie hashing and all other activities that require
RLP encoding of trie nodes by approximately 20%. The speedup is achieved by
avoiding reflection overhead during node encoding.

The interface type trie.node now contains a method 'encode' that works with
rlp.EncoderBuffer. Management of EncoderBuffers is left to calling code.
trie.hasher, which is pooled to avoid allocations, now maintains an
EncoderBuffer. This means memory resources related to trie node encoding
are tied to the hasher pool.

Co-authored-by: Felix Lange <fjl@twurst.com>
2022-03-09 14:45:17 +01:00
..
internal/rlpstruct rlp/rlpgen: RLP encoder code generator (#24251) 2022-02-16 18:14:12 +01:00
rlpgen rlp/rlpgen: RLP encoder code generator (#24251) 2022-02-16 18:14:12 +01:00
decode_tail_test.go all: update license information 2016-04-15 09:48:05 +02:00
decode_test.go rlp/rlpgen: RLP encoder code generator (#24251) 2022-02-16 18:14:12 +01:00
decode.go rlp/rlpgen: RLP encoder code generator (#24251) 2022-02-16 18:14:12 +01:00
doc.go rlp: add support for optional struct fields (#22832) 2021-05-07 14:37:13 +02:00
encbuffer_example_test.go rlp/rlpgen: RLP encoder code generator (#24251) 2022-02-16 18:14:12 +01:00
encbuffer.go rlp, trie: faster trie node encoding (#24126) 2022-03-09 14:45:17 +01:00
encode_test.go rlp, trie: faster trie node encoding (#24126) 2022-03-09 14:45:17 +01:00
encode.go rlp, trie: faster trie node encoding (#24126) 2022-03-09 14:45:17 +01:00
encoder_example_test.go rlp/rlpgen: RLP encoder code generator (#24251) 2022-02-16 18:14:12 +01: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 all: fix warning flagging the use of DeepEqual on error (#23624) 2021-10-19 17:06:47 +02:00
raw.go p2p/rlpx: reduce allocation and syscalls (#22899) 2021-05-27 10:19:13 +02:00
safe.go rlp: minor optimizations for slice/array encoding (#23467) 2021-08-25 19:01:10 +02:00
typecache.go rlp/rlpgen: RLP encoder code generator (#24251) 2022-02-16 18:14:12 +01:00
unsafe.go rlp: minor optimizations for slice/array encoding (#23467) 2021-08-25 19:01:10 +02:00