perf: Add benchmarks and reduce allocations by ~50% for ARC and VOPRF#346
perf: Add benchmarks and reduce allocations by ~50% for ARC and VOPRF#346Lukasa merged 6 commits intoapple:mainfrom
Conversation
38ca3f0 to
6401f81
Compare
6401f81 to
787c112
Compare
|
This looks really cool. I'm curious about if you know how this might interact with a CI strategy? Specifically I don't know how stable the CPU benchmarks would be and if it's possible to only check specific benchmarks in a thresholds check. No worries if you haven't put any thought into this, I'm just curious. |
IIRC our current take was that the CPU time metrics were not stable enough to be part of the CI and that we prefer to use allocations as a proxy for this. |
Motivation
We've recently added some EC operations internally to support some schemes, including ARC and VOPRF. Some of this code is quite allocation-heavy, which could be avoided with some minimally invasive changes.
Modifications
consumingkeyword in some targeted places to reduce allocations in arithmetic- and append-chains.BN_CTXto BoringSSL functions when available.Result
This has resulted in a 50% reduction in allocations for ARC issuance and VOPRF evaluation, and a 34% reduction in ARC verification.