Skip to content

[draft] Remove the dirty linked list in CCoinsViewCache#13

Draft
optout21 wants to merge 1 commit into
masterfrom
2605-coinsviewcache-linkedlist
Draft

[draft] Remove the dirty linked list in CCoinsViewCache#13
optout21 wants to merge 1 commit into
masterfrom
2605-coinsviewcache-linkedlist

Conversation

@optout21

Copy link
Copy Markdown
Owner

WIP
CCoinsViewCache holds a map of all cache entries, and a separate, own-implementation doubly-linked-list for the subset of dirty (and fresh) entries. Experiment with removing this linked list, in order to reduce the memory usage of the cache.
The memory reduction is 2 pointers per cache entry, or 16 bytes (on 64-bit systems), which is roughly a 10.5% reduction in memory (assuming 137 byte avg. size for a cache entry).
Note that the size of these pointers is not considered in the memory measurement of the map (but it still takes up memory).
The linked list is replaced by iterating over all entries, and checking if they are dirty (or fresh, flagged).
Performance aspect is to be evaluated.
Performance depends on the ratio of flagged to total entries. Assuming a long period until the cache is flushed, the number of freshly added outputs and spent outputs should be rather high.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant