marking performance issues
authorChristian Grothoff <christian@grothoff.org>
Fri, 25 Jun 2010 21:41:35 +0000 (21:41 +0000)
committerChristian Grothoff <christian@grothoff.org>
Fri, 25 Jun 2010 21:41:35 +0000 (21:41 +0000)
src/transport/gnunet-service-transport.c
src/transport/plugin_transport_tcp.c
src/transport/test_transport_api_reliability.c
src/transport/test_transport_api_tcp_peer1.conf
src/transport/test_transport_api_tcp_peer2.conf
src/util/scheduler.c

index f9191747e246235fa660c1779944e37ccaa5b2bb..c96652c75cc8075f0167b282dcb694ff696a6a38 100644 (file)
@@ -1772,6 +1772,7 @@ transmit_to_peer (struct TransportClient *client,
   mq = GNUNET_malloc (sizeof (struct MessageQueue) + message_buf_size);
   mq->specific_address = peer_address;
   mq->client = client;
+  /* FIXME: this memcpy can be up to 7% of our total runtime! */
   memcpy (&mq[1], message_buf, message_buf_size);
   mq->message_buf = (const char*) &mq[1];
   mq->message_buf_size = message_buf_size;
@@ -4781,6 +4782,7 @@ handle_send (void *cls,
   tcmc->priority = ntohl (obm->priority);
   tcmc->timeout = GNUNET_TIME_relative_to_absolute (GNUNET_TIME_relative_ntoh (obm->timeout));
   tcmc->msize = msize;
+  /* FIXME: this memcpy can be up to 7% of our total runtime */
   memcpy (&tcmc[1], obmm, msize);
   GNUNET_SERVER_client_keep (client);
   setup_peer_check_blacklist (&obm->peer, GNUNET_YES,
index c1397da610883a2aa97df2b43185f884a9619ccc..08bb00ff6b179c19cef416abe29c69c38d5daa9c 100644 (file)
@@ -647,6 +647,7 @@ do_transmit (void *cls, size_t size, void *buf)
                                   session->pending_messages_tail,
                                   pos);
       GNUNET_assert (size >= pos->message_size);
+      /* FIXME: this memcpy can be up to 7% of our total runtime */
       memcpy (cbuf, pos->msg, pos->message_size);
       cbuf += pos->message_size;
       ret += pos->message_size;
@@ -1089,8 +1090,11 @@ tcp_plugin_send (void *cls,
 
           /* create new message entry */
           pm = GNUNET_malloc (sizeof (struct PendingMessage) + msgbuf_size);
+         /* FIXME: the memset of this malloc can be up to 2% of our total runtime */
           pm->msg = (const char*) &pm[1];
-          memcpy (&pm[1], msg, msgbuf_size);
+          memcpy (&pm[1], msg, msgbuf_size); 
+         /* FIXME: this memcpy can be up to 7% of our total run-time 
+            (for transport service) */
           pm->message_size = msgbuf_size;
           pm->timeout = GNUNET_TIME_relative_to_absolute (timeout);
           pm->transmit_cont = cont;
index 27b86b388607f86a30a14e6004fba84d605459aa..b1891b32db75adf08c491af155dc9bb8d5a557be 100644 (file)
@@ -47,7 +47,7 @@
  * 'MAX_PENDING' in 'gnunet-service-transport.c', otherwise
  * messages may be dropped even for a reliable transport.
  */
-#define TOTAL_MSGS (60000 * 2)
+#define TOTAL_MSGS (60000 * 20)
 
 /**
  * How long until we give up on transmitting the message?
index 363791e1c2a29c1900962403ab679fbc37aa725d..2fe256318828f1bb5fd7513ab8e61c98b9a69f50 100644 (file)
@@ -34,7 +34,7 @@ MINIMUM-FRIENDS = 0
 PLUGINS = tcp
 #DEBUG = YES
 #PREFIX = xterm -T transport2 -e gdb --command=cmd --args
-#PREFIX = valgrind --leak-check=full
+#PREFIX = valgrind --tool=callgrind
 ACCEPT_FROM6 = ::1;
 ACCEPT_FROM = 127.0.0.1;
 NEIGHBOUR_LIMIT = 50
index 3c7a8b8ff574d5e9ca9fadde6fd6a94279c83a72..58abe56eb0481c37707cd6dadb5e26d85dc8246f 100644 (file)
@@ -35,6 +35,7 @@ PLUGINS = tcp
 #DEBUG = YES
 ACCEPT_FROM6 = ::1;
 ACCEPT_FROM = 127.0.0.1;
+#PREFIX = valgrind --tool=callgrind
 NEIGHBOUR_LIMIT = 50
 #BINARY = /home/mrwiggles/documents/research/gnunet/gnunet-ng/src/transport/.libs/gnunet-service-transport
 BINARY = gnunet-service-transport
index b9415202511b0ccb2f53ada6dab242a384af9f1c..5a10987ac510052c7d9d148cb868d52cb24b55b2 100644 (file)
@@ -306,6 +306,10 @@ update_sets (struct GNUNET_SCHEDULER_Handle *sched,
           if (timeout->value > to.value)
             *timeout = to;
         }
+      /* FIXME: this is a very expensive (9% of runtime for some
+        benchmarks!) way to merge the bit sets; specializing
+        the common case where we only have one bit in the pos's
+        set should improve performance dramatically! */
       if (pos->read_set != NULL)
         GNUNET_NETWORK_fdset_add (rs, pos->read_set);
       if (pos->write_set != NULL)
@@ -332,6 +336,10 @@ set_overlaps (const struct GNUNET_NETWORK_FDSet *ready,
 {
   if (NULL == want)
     return GNUNET_NO;
+  /* FIXME: this is a very expensive (10% of runtime for some
+     benchmarks!) way to merge the bit sets; specializing
+     the common case where we only have one bit in the pos's
+     set should improve performance dramatically! */
   if (GNUNET_NETWORK_fdset_overlap (ready, want))
     {
       /* copy all over (yes, there maybe unrelated bits,