diff options
author | Nick Mathewson <nickm@torproject.org> | 2009-06-03 13:52:03 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2009-06-03 13:52:03 -0400 |
commit | b262e7656376a938fc149ae1bf280eeef81c6002 (patch) | |
tree | 16c3a8fee7b10c720fef14df73e53a3a19b6c80f /src/or/main.c | |
parent | c4c7dcd453b62b3d3bcc8e78df8455a77645e62a (diff) | |
download | tor-b262e7656376a938fc149ae1bf280eeef81c6002.tar.gz tor-b262e7656376a938fc149ae1bf280eeef81c6002.zip |
Fix gprof bottlenecks on exit nodes found by Jacob.
Apparently all the stuff that does a linear scan over all the DNS
cache entries can get really expensive when your DNS cache is very
large. It's hard to say how much this will help performance, since
gprof doesn't count time spent in OpenSSL or zlib, but I'd guess 10%.
Also, this patch removes calls to assert_connection_ok() from inside
the read and write callbacks, which are similarly unneeded, and a
little costlier than I'm happy with.
This is probably worth backporting to 0.2.0.
Diffstat (limited to 'src/or/main.c')
-rw-r--r-- | src/or/main.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/or/main.c b/src/or/main.c index a26fd0eff8..8fc712bba3 100644 --- a/src/or/main.c +++ b/src/or/main.c @@ -451,7 +451,7 @@ conn_read_callback(int fd, short event, void *_conn) log_debug(LD_NET,"socket %d wants to read.",conn->s); - assert_connection_ok(conn, time(NULL)); + /* assert_connection_ok(conn, time(NULL)); */ if (connection_handle_read(conn) < 0) { if (!conn->marked_for_close) { @@ -483,7 +483,7 @@ conn_write_callback(int fd, short events, void *_conn) LOG_FN_CONN(conn, (LOG_DEBUG, LD_NET, "socket %d wants to write.",conn->s)); - assert_connection_ok(conn, time(NULL)); + /* assert_connection_ok(conn, time(NULL)); */ if (connection_handle_write(conn, 0) < 0) { if (!conn->marked_for_close) { @@ -529,7 +529,7 @@ conn_close_if_marked(int i) return 0; /* nothing to see here, move along */ now = time(NULL); assert_connection_ok(conn, now); - assert_all_pending_dns_resolves_ok(); + /* assert_all_pending_dns_resolves_ok(); */ log_debug(LD_NET,"Cleaning up connection (fd %d).",conn->s); if ((conn->s >= 0 || conn->linked_conn) && connection_wants_to_flush(conn)) { |