private-attribution / ipa

A raw implementation of Interoperable Private Attribution
MIT License
42 stars 25 forks source link

Create an abstraction for multiply-accumulate #1448

Closed andyleiserson closed 6 days ago

andyleiserson commented 1 week ago

Create an abstraction for multiply-accumulate and provide an optimized implementation for Fp61BitPrime. Currently it is still used only in lagrange::dot_product, but it will soon be used in compute_proof as well.

This change by itself is not meant to affect performance (up or down), it is meant to encapsulate the optimized implementation so that we don't need similar code working with field internals in both dot_product and compute_proof (and anywhere else we might use it in the future).

Without the #[inline] directives, this seemed to hurt performance in my local testing. After adding the #[inline] directives, I do not see a significant performance impact either locally or in draft (before / after) (these runs do include other changes not part of this PR).

Draft: https://draft-mpc.vercel.app/query/view/each-hurt2024-11-20T0056, 2:30. The runs in #1440 were 2:27 and 2:23.

codecov[bot] commented 1 week ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 93.60%. Comparing base (9336e59) to head (7fbeee5). Report is 2 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1448 +/- ## ========================================== + Coverage 93.54% 93.60% +0.05% ========================================== Files 228 230 +2 Lines 39746 40137 +391 ========================================== + Hits 37180 37569 +389 - Misses 2566 2568 +2 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.


🚨 Try these New Features: