794c6133ef
This change is a rewrite of the freezer code. When writing ancient chain data to the freezer, the previous version first encoded each individual item to a temporary buffer, then wrote the buffer. For small item sizes (for example, in the block hash freezer table), this strategy causes a lot of system calls for writing tiny chunks of data. It also allocated a lot of temporary []byte buffers. In the new version, we instead encode multiple items into a re-useable batch buffer, which is then written to the file all at once. This avoids performing a system call for every inserted item. To make the internal batching work, the ancient database API had to be changed. While integrating this new API in BlockChain.InsertReceiptChain, additional optimizations were also added there. Co-authored-by: Felix Lange <fjl@twurst.com> |
||
---|---|---|
.. | ||
accessors_chain_test.go | ||
accessors_chain.go | ||
accessors_indexes_test.go | ||
accessors_indexes.go | ||
accessors_metadata.go | ||
accessors_snapshot.go | ||
accessors_state.go | ||
chain_iterator_test.go | ||
chain_iterator.go | ||
database_test.go | ||
database.go | ||
freezer_batch.go | ||
freezer_table_test.go | ||
freezer_table.go | ||
freezer_test.go | ||
freezer.go | ||
schema.go | ||
table_test.go | ||
table.go |