-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Closed
Labels
Description
Mempool.Update(txs) job is to ensure that every tx in txs is removed from the mempool. This is currently done by creating a hashmap of strings, and putting all of these txs in there. Then one iterates through the mempool, casts each tx to string, and checks if its in the mempool. This has two constant overheads per tx, converting every tx in the mempool to a string, and AES-hashing every tx in the mempool.
I think instead, we should use a tree map over the []byte representation directly. We can make the ordering condition for the tree map length and then direct big endian byte comparison. I suspect this will make for a significantly faster update function.
Reactions are currently unavailable