[or-cvs] r9610: As a trivial optimization, remove a redundant call to router (in tor/trunk: . src/or)

nickm at seul.org nickm at seul.org
Wed Feb 21 05:57:05 UTC 2007


Author: nickm
Date: 2007-02-21 00:56:53 -0500 (Wed, 21 Feb 2007)
New Revision: 9610

Modified:
   tor/trunk/
   tor/trunk/ChangeLog
   tor/trunk/src/or/circuituse.c
   tor/trunk/src/or/routerlist.c
Log:
 r11858 at 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.



Property changes on: tor/trunk
___________________________________________________________________
 svk:merge ticket from /tor/trunk [r11858] on 8246c3cf-6607-4228-993b-4d95d33730f1

Modified: tor/trunk/ChangeLog
===================================================================
--- tor/trunk/ChangeLog	2007-02-21 05:56:47 UTC (rev 9609)
+++ tor/trunk/ChangeLog	2007-02-21 05:56:53 UTC (rev 9610)
@@ -53,6 +53,10 @@
     - 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.

Modified: tor/trunk/src/or/circuituse.c
===================================================================
--- tor/trunk/src/or/circuituse.c	2007-02-21 05:56:47 UTC (rev 9609)
+++ tor/trunk/src/or/circuituse.c	2007-02-21 05:56:53 UTC (rev 9610)
@@ -445,7 +445,10 @@
   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) {

Modified: tor/trunk/src/or/routerlist.c
===================================================================
--- tor/trunk/src/or/routerlist.c	2007-02-21 05:56:47 UTC (rev 9609)
+++ tor/trunk/src/or/routerlist.c	2007-02-21 05:56:53 UTC (rev 9610)
@@ -4154,7 +4154,7 @@
 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;
   }



More information about the tor-commits mailing list