summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2007-02-21 05:56:53 +0000
committerNick Mathewson <nickm@torproject.org>2007-02-21 05:56:53 +0000
commit2a4fc8533cf059b48b6b509e91331d05ab388240 (patch)
tree67d3bff76dc2ce0898137f0d629e5555e036a2ca
parentdd726678b5fecd1044e80bc31ad93ab5d5132e92 (diff)
downloadtor-2a4fc8533cf059b48b6b509e91331d05ab388240.tar.gz
tor-2a4fc8533cf059b48b6b509e91331d05ab388240.zip
r11858@catbus: nickm | 2007-02-21 00:27:44 -0500
As a trivial optimization, remove a redundant call to router_have_minimum_dir_info. This might shave 2% on some systems by according to some profilers. svn:r9610
-rw-r--r--ChangeLog4
-rw-r--r--src/or/circuituse.c5
-rw-r--r--src/or/routerlist.c2
3 files changed, 9 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index bca9c7f260..8cab8bb667 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -53,6 +53,10 @@ Changes in version 0.1.2.8-alpha - 2007-??-??
- Add STREAM_BW events to report per-entry-stream bandwidth use. (Patch
from Robert Hogan.)
+ o Minor bugfixes (performance):
+ - Call router_have_min_dir_info half as often. (This is showing up in
+ some profiles, but not others.)
+
o Minor features:
- Remove some never-implemented options. Mark PathlenCoinWeight as
obsolete.
diff --git a/src/or/circuituse.c b/src/or/circuituse.c
index 6cc7f54f07..e85b7c0b4a 100644
--- a/src/or/circuituse.c
+++ b/src/or/circuituse.c
@@ -445,7 +445,10 @@ circuit_build_needed_circs(time_t now)
connection_ap_attach_pending();
/* make sure any hidden services have enough intro points */
- if (router_have_minimum_dir_info())
+ /* XXXX012 circuit_build_needed_circs is only called at all if
+ * router_have_minimum_dir_info is true; this check is redundant,
+ * and it appears to show up on some people's profiles. */
+ if (1 || router_have_minimum_dir_info())
rend_services_introduce();
if (time_to_new_circuit < now) {
diff --git a/src/or/routerlist.c b/src/or/routerlist.c
index dc3f85c941..76e34aa515 100644
--- a/src/or/routerlist.c
+++ b/src/or/routerlist.c
@@ -4154,7 +4154,7 @@ static int need_to_update_have_min_dir_info = 1;
int
router_have_minimum_dir_info(void)
{
- if (need_to_update_have_min_dir_info) {
+ if (PREDICT_FALSE(need_to_update_have_min_dir_info)) {
update_router_have_minimum_dir_info();
need_to_update_have_min_dir_info = 0;
}