hashgraph / hedera-services

Crypto, token, consensus, file, and smart contract services for the Hedera public ledger
Apache License 2.0
295 stars 127 forks source link

Add in-memory mode to `VirtualMap` for smaller number of entries #13246

Closed imalygin closed 2 months ago

imalygin commented 4 months ago

It would be very useful to be able to store very small virtual maps totally in memory. Roster maps would use this, and any current structures that are queues. Queues are not efficient for hashing, so it would be better to store them as in memory maps.

A new configuration is required to indicate that a particular map should be kept in memory. The VirtualNodeCache also needs to be updated to eliminate a memory leak that would happen if there are no flushes, which would be the case for in-memory virtual maps.

poulok commented 3 months ago

We need to determine if we are going to have a single virtual map for the entire state using complex keys, or a binary tree first.

poulok commented 2 months ago

This ticket is no longer relevant due to the decision to organize the state a single large virtual map.