Page MenuHomePhabricator

crypto: Make MuHash Remove method efficient
ClosedPublic

Authored by PiRK on Mar 15 2022, 09:08.

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Commits
rABC7082554a0fc5: 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

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

PiRK requested review of this revision.Mar 15 2022, 09:08
Fabien requested changes to this revision.Mar 15 2022, 15:07
Fabien added a subscriber: Fabien.

That's the wrong commit

This revision now requires changes to proceed.Mar 15 2022, 15:07
PiRK requested review of this revision.Mar 15 2022, 15:11
PiRK edited the summary of this revision. (Show Details)

Fixed.

This revision is now accepted and ready to land.Mar 15 2022, 15:20