[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-bugs] #16535 [Tor]: Investigate building ed25519-donna with SSE2 support.



#16535: Investigate building ed25519-donna with SSE2 support.
------------------------------------------+--------------------------------
 Reporter:  yawning                       |          Owner:
     Type:  enhancement                   |         Status:  new
 Priority:  minor                         |      Milestone:  Tor:
Component:  Tor                           |  0.2.7.x-final
 Keywords:  tor-relay, performance, ntor  |        Version:  Tor: 0.2.7
Parent ID:                                |  Actual Points:
                                          |         Points:
------------------------------------------+--------------------------------
 Followup to #9663/#16467, now that we include ed25519-donna, we should
 look into building it with SSE2 support where appropriate.

 Adding something like this to `ed25519-donna-portable.h` should do the
 trick:
 {{{
 /* Tor: Build with SSE2 where it makes sense to do so. */
 #if defined(__SSE2__) && !(defined(__x86_64__) || defined(__amd64__))
 #define ED25519_SSE2
 #endif
 }}}

 Potential pitfalls:
  * SSE2 builds benchmark worse on x86_64, at least Haswell.
  * This opens us up to potentially really obnoxious compiler
 bugs/pathologically bad code generation.
  * Most distribution packages probably don't build for an architecture
 that will define `_SSE2_`, so this would only get picked up by people
 doing custom builds.

 Open questions:
  * Is this actually faster on 32 bit Intel?
  * Is doing something like "always building SSE2 and non-SSE2 and using
 CPUID to pick at runtime" sensible? (I personally think "No").

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/16535>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
_______________________________________________
tor-bugs mailing list
tor-bugs@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs