Optimize _double_var #164

pull peterdettman wants to merge 1 commits into bitcoin-core:master from peterdettman:opt-double-var changing 1 files +25 −18
  1. peterdettman commented at 4:16 pm on December 14, 2014: contributor
    • Save 1 _fe_negate
    • Prefer operations on local variables
    • Reorder code somewhat to group inline function calls together

    I am definitely looking for others to test this one. I measure up to 1% improvement for bench_verify, but of the three things I listed above, the “reorder code” measures as the most significant, so it’s possible I have only optimized for my machine/compiler somehow.

  2. sipa commented at 7:36 pm on December 14, 2014: contributor
    I can’t measure any improvement (with or without endomorphism optimization).
  3. peterdettman commented at 2:29 pm on December 16, 2014: contributor

    @sipa I was afraid you’d say that! Still, I don’t think I’ve gone crazy; I’ve been round and around with the benchmarking and there’s still a 1% difference for bench_verify (in my setup).

    Hopefully we could hear from a few others (maybe platform/compiler is a factor?). For the record, I’m on an i7, OSX 10.10.1, using gcc 4.9.2 from macports (but with the clang assembler via -Wa,-q), –with-field=64bit –enable-endomorphism=yes, -O3 -march=native.

    Actually, with endo=no, the difference widens to about 1.5%, as “expected” I guess. If I use -O2, the difference is much smaller, if actually there; similarly if I remove -march=native.

  4. peterdettman force-pushed on Dec 16, 2014
  5. peterdettman force-pushed on Dec 23, 2014
  6. sipa commented at 1:02 am on February 13, 2015: contributor
    This results in a measurable 0.2% slowdown for me…
  7. peterdettman commented at 5:42 am on February 13, 2015: contributor
    @sipa I’ll re-test when I get a chance.
  8. Optimize _double_var
    - Save 1 _fe_negate
    - Prefer operations on local variables
    - Reorder code somewhat to group inline function calls together
    9f6aecbf23
  9. peterdettman force-pushed on Feb 13, 2015
  10. peterdettman commented at 1:08 pm on February 13, 2015: contributor
    @sipa Well, I still see a difference (bench_verify), but it’s smaller now, ~0.2us/55us. Since it’s inconsistent at best… closed!
  11. peterdettman closed this on Feb 13, 2015


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: 2024-11-22 23:15 UTC

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