diff options
author | Christian Grothoff <christian@grothoff.org> | 2010-06-25 21:41:35 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2010-06-25 21:41:35 +0000 |
commit | 1174c809820401ec254a701b4d478a8e88b8af59 (patch) | |
tree | 6f68cc38ef9fafcc63f478fd8b71c46deace5fc0 /src/transport | |
parent | 59921d3b90ed8bf823605517f6692c26a1c9dc44 (diff) | |
download | gnunet-1174c809820401ec254a701b4d478a8e88b8af59.tar.gz gnunet-1174c809820401ec254a701b4d478a8e88b8af59.zip |
marking performance issues
Diffstat (limited to 'src/transport')
-rw-r--r-- | src/transport/gnunet-service-transport.c | 2 | ||||
-rw-r--r-- | src/transport/plugin_transport_tcp.c | 6 | ||||
-rw-r--r-- | src/transport/test_transport_api_reliability.c | 2 | ||||
-rw-r--r-- | src/transport/test_transport_api_tcp_peer1.conf | 2 | ||||
-rw-r--r-- | src/transport/test_transport_api_tcp_peer2.conf | 1 |
5 files changed, 10 insertions, 3 deletions
diff --git a/src/transport/gnunet-service-transport.c b/src/transport/gnunet-service-transport.c index f9191747e..c96652c75 100644 --- a/src/transport/gnunet-service-transport.c +++ b/src/transport/gnunet-service-transport.c | |||
@@ -1772,6 +1772,7 @@ transmit_to_peer (struct TransportClient *client, | |||
1772 | mq = GNUNET_malloc (sizeof (struct MessageQueue) + message_buf_size); | 1772 | mq = GNUNET_malloc (sizeof (struct MessageQueue) + message_buf_size); |
1773 | mq->specific_address = peer_address; | 1773 | mq->specific_address = peer_address; |
1774 | mq->client = client; | 1774 | mq->client = client; |
1775 | /* FIXME: this memcpy can be up to 7% of our total runtime! */ | ||
1775 | memcpy (&mq[1], message_buf, message_buf_size); | 1776 | memcpy (&mq[1], message_buf, message_buf_size); |
1776 | mq->message_buf = (const char*) &mq[1]; | 1777 | mq->message_buf = (const char*) &mq[1]; |
1777 | mq->message_buf_size = message_buf_size; | 1778 | mq->message_buf_size = message_buf_size; |
@@ -4781,6 +4782,7 @@ handle_send (void *cls, | |||
4781 | tcmc->priority = ntohl (obm->priority); | 4782 | tcmc->priority = ntohl (obm->priority); |
4782 | tcmc->timeout = GNUNET_TIME_relative_to_absolute (GNUNET_TIME_relative_ntoh (obm->timeout)); | 4783 | tcmc->timeout = GNUNET_TIME_relative_to_absolute (GNUNET_TIME_relative_ntoh (obm->timeout)); |
4783 | tcmc->msize = msize; | 4784 | tcmc->msize = msize; |
4785 | /* FIXME: this memcpy can be up to 7% of our total runtime */ | ||
4784 | memcpy (&tcmc[1], obmm, msize); | 4786 | memcpy (&tcmc[1], obmm, msize); |
4785 | GNUNET_SERVER_client_keep (client); | 4787 | GNUNET_SERVER_client_keep (client); |
4786 | setup_peer_check_blacklist (&obm->peer, GNUNET_YES, | 4788 | setup_peer_check_blacklist (&obm->peer, GNUNET_YES, |
diff --git a/src/transport/plugin_transport_tcp.c b/src/transport/plugin_transport_tcp.c index c1397da61..08bb00ff6 100644 --- a/src/transport/plugin_transport_tcp.c +++ b/src/transport/plugin_transport_tcp.c | |||
@@ -647,6 +647,7 @@ do_transmit (void *cls, size_t size, void *buf) | |||
647 | session->pending_messages_tail, | 647 | session->pending_messages_tail, |
648 | pos); | 648 | pos); |
649 | GNUNET_assert (size >= pos->message_size); | 649 | GNUNET_assert (size >= pos->message_size); |
650 | /* FIXME: this memcpy can be up to 7% of our total runtime */ | ||
650 | memcpy (cbuf, pos->msg, pos->message_size); | 651 | memcpy (cbuf, pos->msg, pos->message_size); |
651 | cbuf += pos->message_size; | 652 | cbuf += pos->message_size; |
652 | ret += pos->message_size; | 653 | ret += pos->message_size; |
@@ -1089,8 +1090,11 @@ tcp_plugin_send (void *cls, | |||
1089 | 1090 | ||
1090 | /* create new message entry */ | 1091 | /* create new message entry */ |
1091 | pm = GNUNET_malloc (sizeof (struct PendingMessage) + msgbuf_size); | 1092 | pm = GNUNET_malloc (sizeof (struct PendingMessage) + msgbuf_size); |
1093 | /* FIXME: the memset of this malloc can be up to 2% of our total runtime */ | ||
1092 | pm->msg = (const char*) &pm[1]; | 1094 | pm->msg = (const char*) &pm[1]; |
1093 | memcpy (&pm[1], msg, msgbuf_size); | 1095 | memcpy (&pm[1], msg, msgbuf_size); |
1096 | /* FIXME: this memcpy can be up to 7% of our total run-time | ||
1097 | (for transport service) */ | ||
1094 | pm->message_size = msgbuf_size; | 1098 | pm->message_size = msgbuf_size; |
1095 | pm->timeout = GNUNET_TIME_relative_to_absolute (timeout); | 1099 | pm->timeout = GNUNET_TIME_relative_to_absolute (timeout); |
1096 | pm->transmit_cont = cont; | 1100 | pm->transmit_cont = cont; |
diff --git a/src/transport/test_transport_api_reliability.c b/src/transport/test_transport_api_reliability.c index 27b86b388..b1891b32d 100644 --- a/src/transport/test_transport_api_reliability.c +++ b/src/transport/test_transport_api_reliability.c | |||
@@ -47,7 +47,7 @@ | |||
47 | * 'MAX_PENDING' in 'gnunet-service-transport.c', otherwise | 47 | * 'MAX_PENDING' in 'gnunet-service-transport.c', otherwise |
48 | * messages may be dropped even for a reliable transport. | 48 | * messages may be dropped even for a reliable transport. |
49 | */ | 49 | */ |
50 | #define TOTAL_MSGS (60000 * 2) | 50 | #define TOTAL_MSGS (60000 * 20) |
51 | 51 | ||
52 | /** | 52 | /** |
53 | * How long until we give up on transmitting the message? | 53 | * How long until we give up on transmitting the message? |
diff --git a/src/transport/test_transport_api_tcp_peer1.conf b/src/transport/test_transport_api_tcp_peer1.conf index 363791e1c..2fe256318 100644 --- a/src/transport/test_transport_api_tcp_peer1.conf +++ b/src/transport/test_transport_api_tcp_peer1.conf | |||
@@ -34,7 +34,7 @@ MINIMUM-FRIENDS = 0 | |||
34 | PLUGINS = tcp | 34 | PLUGINS = tcp |
35 | #DEBUG = YES | 35 | #DEBUG = YES |
36 | #PREFIX = xterm -T transport2 -e gdb --command=cmd --args | 36 | #PREFIX = xterm -T transport2 -e gdb --command=cmd --args |
37 | #PREFIX = valgrind --leak-check=full | 37 | #PREFIX = valgrind --tool=callgrind |
38 | ACCEPT_FROM6 = ::1; | 38 | ACCEPT_FROM6 = ::1; |
39 | ACCEPT_FROM = 127.0.0.1; | 39 | ACCEPT_FROM = 127.0.0.1; |
40 | NEIGHBOUR_LIMIT = 50 | 40 | NEIGHBOUR_LIMIT = 50 |
diff --git a/src/transport/test_transport_api_tcp_peer2.conf b/src/transport/test_transport_api_tcp_peer2.conf index 3c7a8b8ff..58abe56eb 100644 --- a/src/transport/test_transport_api_tcp_peer2.conf +++ b/src/transport/test_transport_api_tcp_peer2.conf | |||
@@ -35,6 +35,7 @@ PLUGINS = tcp | |||
35 | #DEBUG = YES | 35 | #DEBUG = YES |
36 | ACCEPT_FROM6 = ::1; | 36 | ACCEPT_FROM6 = ::1; |
37 | ACCEPT_FROM = 127.0.0.1; | 37 | ACCEPT_FROM = 127.0.0.1; |
38 | #PREFIX = valgrind --tool=callgrind | ||
38 | NEIGHBOUR_LIMIT = 50 | 39 | NEIGHBOUR_LIMIT = 50 |
39 | #BINARY = /home/mrwiggles/documents/research/gnunet/gnunet-ng/src/transport/.libs/gnunet-service-transport | 40 | #BINARY = /home/mrwiggles/documents/research/gnunet/gnunet-ng/src/transport/.libs/gnunet-service-transport |
40 | BINARY = gnunet-service-transport | 41 | BINARY = gnunet-service-transport |