memory
Posts on how Cinder uses memory: the size of trie nodes and other data, and the changes that made them smaller.
- An estimate of 3.9% and a result in the noise: why we rejected lazy branch decodeWe wanted to decode the 16 children of a trie branch only when a walk reaches them. A scratch build first estimated the possible gain at 3.9% of the block time. We built two versions and measured them on 1 074 mainnet blocks. The first was slower. The second was in the noise of the A/A control. The work memory went down by 13%, but the block time did not. This post shows the data behind the decision, and why the estimate was too high.
- A hash is not a node: trie references of 36 bytes instead of 208A profile of the state root found about 109 000 trie node objects per mainnet block for about 9 500 decoded nodes. Most of them were children that are only a hash, and each one got a full node of 208 bytes. We made a hash reference a node of 36 bytes. On 1 074 mainnet blocks, a block took 0.923 of the time before. The work memory of a block is 37% smaller, and every root is the same.