mirror of
https://github.com/status-im/nimbus-eth1.git
synced 2025-01-22 10:09:24 +00:00
f3a56002ca
The Vertex type unifies branches, extensions and leaves into a single memory area where the larges member is the branch (128 bytes + overhead) - the payloads we have are all smaller than 128 thus wrapping them in an extra layer of `ref` is wasteful from a memory usage perspective. Further, the ref:s must be visited during the M&S phase of garbage collection - since we keep millions of these, many of them short-lived, this takes up significant CPU time. ``` Function CPU Time: Total CPU Time: Self Module Function (Full) Source File Start Address system::markStackAndRegisters 10.0% 4.922s nimbus system::markStackAndRegisters(var<system::GcHeap>).constprop.0 gc.nim 0x701230` ```
Core database
Layout of CoreDb
descriptor objects
Objects dependence:
CoreDbRef -- Base descriptor
| | |
| | +--- CoreDbCtxRef -- Context descriptor
| | | | | |
| | | | | +--- CoreDbKvtRef -- Key-value table
| | | | |
| | | | +----- CoreDbMptRef -- Generic MPT
| | | |
| | | +------- CoreDbAccRef -- Accounts database
| | |
| | +--------- CoreDbTxRef -- Transaction handle
| |
| +----- CoreDbCtxRef
| : : : :
|
+------- CoreDbCtxRef
: : : :