HomePhabricator

crypto: Make MuHash Remove method efficient

Description

crypto: Make MuHash Remove method efficient

Summary:
Division of MuHash objects are very expensive and multiplication relatively cheap. The whole idea of introducing and tracking numerator and denominators seperately as a representation of the internal state was so that divisions would be rare. So using divison in the Remove method did not make any sense and was just a silly mistake which is corrected here.

This is a partial backport of core#19521
https://github.com/bitcoin/bitcoin/pull/19521/commits/2e2648a9021dfbb6e17dfa81472f057dacbc34e0

Test Plan: ninja all check-all

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Subscribers: Fabien

Differential Revision: https://reviews.bitcoinabc.org/D11168

Details

Provenance
Fabian Jahr <fjahr@protonmail.com>Authored on Feb 25 2021, 18:09
PiRKCommitted on Mar 15 2022, 15:44
PiRKPushed on Mar 15 2022, 15:44
Reviewer
Restricted Project
Differential Revision
D11168: crypto: Make MuHash Remove method efficient
Parents
rABC042da95f2833: [Cashtab] Remove unused styled import from TokenIcon.js
Branches
Unknown
Tags
Unknown