gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r4266 - GNUnet/src/util/crypto


From: grothoff
Subject: [GNUnet-SVN] r4266 - GNUnet/src/util/crypto
Date: Mon, 8 Jan 2007 20:15:51 -0800 (PST)

Author: grothoff
Date: 2007-01-08 20:15:50 -0800 (Mon, 08 Jan 2007)
New Revision: 4266

Modified:
   GNUnet/src/util/crypto/Makefile.am
   GNUnet/src/util/crypto/hashperf.c
Log:
forcing -O3 for crypto -- reduces CPU usage by almost 50%

Modified: GNUnet/src/util/crypto/Makefile.am
===================================================================
--- GNUnet/src/util/crypto/Makefile.am  2007-01-09 04:05:32 UTC (rev 4265)
+++ GNUnet/src/util/crypto/Makefile.am  2007-01-09 04:15:50 UTC (rev 4266)
@@ -4,7 +4,7 @@
 
 lib_LTLIBRARIES = libgnunetutil_crypto.la
 
-AM_CPPFLAGS = $(LIBGCRYPT_CFLAGS)
+AM_CPPFLAGS = $(LIBGCRYPT_CFLAGS) -O3
 
 libgnunetutil_crypto_la_LIBADD = \
  $(GCLIBADD) \

Modified: GNUnet/src/util/crypto/hashperf.c
===================================================================
--- GNUnet/src/util/crypto/hashperf.c   2007-01-09 04:05:32 UTC (rev 4265)
+++ GNUnet/src/util/crypto/hashperf.c   2007-01-09 04:15:50 UTC (rev 4266)
@@ -38,7 +38,7 @@
   buf = MALLOC(1024*64);
   memset(buf, 1, 1024 * 64);
   hash("foo", 3, &hc1);
-  for (i=0;i<1024*1024;i++) {
+  for (i=0;i<1024;i++) {
     hash(&hc1, 
         sizeof(HashCode512),
         &hc2);
@@ -52,12 +52,10 @@
 }
 
 int main(int argc, char * argv[]) {
-  int i;
   cron_t start;
 
   start = get_time();
-  for (i=0;i<10;i++)
-    perfHash();
+  perfHash();
   printf("Hash perf took %llu ms\n",
         get_time() - start);
   return 0;





reply via email to

[Prev in Thread] Current Thread [Next in Thread]