bsc/rlp
Felix Lange 088da24ebf
rlp: improve decoder stream implementation (#22858)
This commit makes various cleanup changes to rlp.Stream.

* rlp: shrink Stream struct

This removes a lot of unused padding space in Stream by reordering the
fields. The size of Stream changes from 120 bytes to 88 bytes. Stream
instances are internally cached and reused using sync.Pool, so this does
not improve performance.

* rlp: simplify list stack

The list stack kept track of the size of the current list context as
well as the current offset into it. The size had to be stored in the
stack in order to subtract it from the remaining bytes of any enclosing
list in ListEnd. It seems that this can be implemented in a simpler
way: just subtract the size from the enclosing list context in List instead.
2021-05-18 12:10:27 +02:00
..
decode_tail_test.go all: update license information 2016-04-15 09:48:05 +02:00
decode_test.go rlp: add support for optional struct fields (#22832) 2021-05-07 14:37:13 +02:00
decode.go rlp: improve decoder stream implementation (#22858) 2021-05-18 12:10:27 +02:00
doc.go rlp: add support for optional struct fields (#22832) 2021-05-07 14:37:13 +02:00
encode_test.go rlp: add support for optional struct fields (#22832) 2021-05-07 14:37:13 +02:00
encode.go rlp: add support for optional struct fields (#22832) 2021-05-07 14:37:13 +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 core/types, rlp: optimize derivesha (#21728) 2020-11-04 19:29:24 +01:00
raw.go core/types, rlp: optimize derivesha (#21728) 2020-11-04 19:29:24 +01:00
typecache.go rlp: add support for optional struct fields (#22832) 2021-05-07 14:37:13 +02:00