Ver código fonte

various optimization

Adam Ierymenko 5 anos atrás
pai
commit
c5bd21a23e
4 arquivos alterados com 8 adições e 3 exclusões
  1. 2 0
      CMakeLists.txt
  2. 1 1
      node/AES.hpp
  3. 3 0
      node/MIMC52.cpp
  4. 2 2
      node/Tests.cpp

+ 2 - 0
CMakeLists.txt

@@ -61,6 +61,7 @@ else(WIN32)
 			$<$<CONFIG:Debug>:-g>
 			$<$<CONFIG:DEBUG>:-O0>
 			$<$<CONFIG:RELEASE>:-Ofast>
+			$<$<CONFIG:RELEASE>:-ffast-math>
 			$<$<CONFIG:RELEASE>:-fPIE>
 			$<$<CONFIG:RELEASE>:-flto>
 			$<$<CONFIG:RELWITHDEBINFO>:-Ofast>
@@ -80,6 +81,7 @@ else(WIN32)
 			$<$<CONFIG:Debug>:-g>
 			$<$<CONFIG:DEBUG>:-O0>
 			$<$<CONFIG:RELEASE>:-O3>
+			$<$<CONFIG:RELEASE>:-ffast-math>
 			$<$<CONFIG:RELEASE>:-fPIE>
 			$<$<CONFIG:RELWITHDEBINFO>:-O3>
 			$<$<CONFIG:RELWITHDEBINFO>:-fPIE>

+ 1 - 1
node/AES.hpp

@@ -22,7 +22,7 @@
 #include <cstring>
 
 #ifndef ZT_AES_NO_ACCEL
-#if (defined(__amd64) || defined(__amd64__) || defined(__x86_64) || defined(__x86_64__) || defined(__AMD64) || defined(__AMD64__) || defined(_M_X64))
+#ifdef ZT_ARCH_X64
 #include <wmmintrin.h>
 #include <emmintrin.h>
 #include <smmintrin.h>

Diferenças do arquivo suprimidas por serem muito extensas
+ 3 - 0
node/MIMC52.cpp


+ 2 - 2
node/Tests.cpp

@@ -1029,7 +1029,7 @@ extern "C" const char *ZTT_benchmarkCrypto()
 			for(long i=0;i<10;++i)
 				foo = (uint8_t)id.locallyValidate();
 			end = now();
-			ZT_T_PRINTF("%.4f μs/validation" ZT_EOL_S,((double)(end - start) * 1000.0) / 10.0);
+			ZT_T_PRINTF("%.4f ms/validation" ZT_EOL_S,(double)(end - start) / 10.0);
 			ZT_T_PRINTF("[crypto] Benchmarking V1 Identity generation... ");
 			start = now();
 			for(long i=0;i<5;++i) {
@@ -1043,7 +1043,7 @@ extern "C" const char *ZTT_benchmarkCrypto()
 			for(long i=0;i<100;++i)
 				foo = (uint8_t)id.locallyValidate();
 			end = now();
-			ZT_T_PRINTF("%.4f μs/validation" ZT_EOL_S,((double)(end - start) * 1000.0) / 100.0);
+			ZT_T_PRINTF("%.4f ms/validation" ZT_EOL_S,(double)(end - start) / 100.0);
 		}
 	} catch (std::exception &e) {
 		ZT_T_PRINTF(ZT_EOL_S "[crypto] Unexpected exception: %s" ZT_EOL_S,e.what());

Alguns arquivos não foram mostrados porque muitos arquivos mudaram nesse diff