bench: add internal benchmark for `secp256k1_fe_normalize_var` #1855

pull theStack wants to merge 1 commits into bitcoin-core:master from theStack:add-field_normalize_var-bench changing 1 files +10 −0
  1. theStack commented at 10:49 PM on May 14, 2026: contributor

    While addressing the review suggestion #1765 (review) (b10c mirror link), I noticed that we don't have an internal benchmark for the variable-time variant of _fe_normalize yet, so this PR adds one. IIUC it's fine to repeatedly apply the operation on the same (already normalized at latest after the first loop iteration) field element for benchmarking purposes and don't put in an effort to reach the final reduction code path, considering how extremely unlikely it is to reach it in practice.

    Results on my machine:

    $ ./build/bin/bench_internal normalize
    Benchmark                     ,    Min(us)    ,    Avg(us)    ,    Max(us)    
    
    field_normalize               ,     0.0103    ,     0.0106    ,     0.0128 
    field_normalize_var           ,     0.00545   ,     0.00546   ,     0.00547
    field_normalize_weak          ,     0.00352   ,     0.00354   ,     0.00363
    
  2. bench: add internal benchmark for `secp256k1_fe_normalize_var` 8b066a4dd7

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin-core/secp256k1. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-05-16 16:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me