Use faster byteswapping and avoid alignment-increasing casts #216

pull sipa wants to merge 1 commits into bitcoin-core:master from sipa:byteswap changing 3 files +44 −55
  1. sipa commented at 0:25 am on February 15, 2015: contributor
  2. sipa commented at 4:18 am on February 15, 2015: contributor
    9% faster SHA256 and RFC6979.
  3. gmaxwell commented at 8:08 am on February 15, 2015: contributor
    ACK. (remind me to test on BE if I forget to remove this request.)
  4. sipa commented at 7:31 pm on February 16, 2015: contributor
    clang seems to warn about changed alignment when casting. I don’t see why that is a problem, so perhaps we should try to avoid that warning?
  5. sipa commented at 3:28 am on February 18, 2015: contributor
    @theuni opinion?
  6. theuni commented at 6:49 am on February 19, 2015: contributor
    @sipa I took a quick stab at avoiding changing alignment requirements: https://github.com/theuni/secp256k1/commit/78df7673f9d31627ae6425face109a0df6ac08ac just to see how much trouble it’d be. Assuming I didn’t muck it up too badly, overhead seems minimal. It’s hard to imagine this causing any real issues, though.
  7. sipa commented at 9:48 am on February 21, 2015: contributor
    Hmm, a 1% slowdown. This shouldn’t be necessary at all…
  8. sipa force-pushed on Feb 22, 2015
  9. sipa renamed this:
    Use byteswapping where available, instead of manual shifting
    Use faster byteswapping and avoid alignment-increasing casts
    on Feb 22, 2015
  10. sipa commented at 2:31 pm on February 22, 2015: contributor

    I’ve rewritten this based on @theuni’s suggestion, taking it a step further. Oddly enough, it’s even faster than the previous version.

    Also, I’ve just switched to a different byteswapping macro, which recent GCC at -O2 and above automatically convert to a bswap instruction.

  11. sipa commented at 11:14 am on February 23, 2015: contributor
    @theuni clang-3.5 also optimizes the construct to a bswap; I haven’t tried any other implementation.
  12. sipa commented at 11:21 am on February 23, 2015: contributor
    10.5% faster hashing now.
  13. Use faster byteswapping and avoid alignment-increasing casts. ae55e850c7
  14. sipa force-pushed on Feb 23, 2015
  15. theuni commented at 11:29 pm on February 23, 2015: contributor
    Nice! Tested ACK. Roughly an 8% speedup here from a very quick test.
  16. sipa merged this on Feb 24, 2015
  17. sipa closed this on Feb 24, 2015

  18. sipa referenced this in commit 137a8ec45b on Feb 24, 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-10-30 03:15 UTC

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