HomePhabricator

mapNextTx: use pointer as key, simplify value
9805f4af7ecbUnpublished

Unpublished Commit ยท Learn More

Repository Importing: This repository is still importing.

Description

mapNextTx: use pointer as key, simplify value

Saves about 10% of application memory usage once the mempool warms up. Since the
mempool is DynamicUsage-regulated, this will translate to a larger mempool in
the same amount of space.

Map value type: eliminate the vin index; no users of the map need to know which
input of the transaction is spending the prevout.

Map key type: replace the COutPoint with a pointer to a COutPoint. A COutPoint
is 36 bytes, but each COutPoint is accessible from the same map entry's value.
A trivial DereferencingComparator functor allows indirect map keys, but the
resulting syntax is misleading: map.find(&outpoint). Implement an indirectmap
that acts as a wrapper to a map that uses a DereferencingComparator, supporting
a syntax that accurately reflect the container's semantics: inserts and
iterators use pointers since they store pointers and need them to remain
constant and dereferenceable, but lookup functions take const references.

Details

Provenance
Kaz Wesley <keziahw@gmail.com>Authored on May 1 2016, 04:45
schancelPushed on Jan 5 2018, 21:58
schancelPushed on Jan 5 2018, 21:39
schancelPushed on Jan 5 2018, 21:17
Parents
rSTAGING03cf6e867502: Merge #7959: fix race that could fail to persist a ban
Branches
Unknown
Tags
Unknown

Event Timeline

Kaz Wesley <keziahw@gmail.com> committed rSTAGING9805f4af7ecb: mapNextTx: use pointer as key, simplify value (authored by Kaz Wesley <keziahw@gmail.com>).Jun 2 2016, 19:31