• rjl493456442's avatar
    core, ethdb, tests, trie: implement NewBatchWithSize API for batcher (#24392) · 4d086430
    rjl493456442 authored
    This PR adds an addtional API called `NewBatchWithSize` for db
    batcher. It turns out that leveldb batch memory allocation is
    super inefficient. The main reason is the allocation step of
    leveldb Batch is too small when the batch size is large. It can
    take a few second to build a leveldb batch with 100MB size.
    
    Luckily, leveldb also offers another API called MakeBatch which can
    pre-allocate the memory area. So if the approximate size of batch is
    known in advance, this API can be used in this case.
    
    It's needed in new state scheme PR which needs to commit a batch of
    trie nodes in a single batch. Implement the feature in a seperate PR.
    4d086430
Name
Last commit
Last update
..
abi Loading commit data...
bitutil Loading commit data...
bls12381 Loading commit data...
bn256 Loading commit data...
difficulty Loading commit data...
keystore Loading commit data...
les Loading commit data...
rangeproof Loading commit data...
rlp Loading commit data...
runtime Loading commit data...
secp256k1 Loading commit data...
snap Loading commit data...
stacktrie Loading commit data...
trie Loading commit data...
txfetcher Loading commit data...
vflux Loading commit data...
README.md Loading commit data...