[tor-bugs] #12170 [Tor]: Investigate performance issues surrounding count_usable_descriptors()

Tor Bug Tracker & Wiki blackhole at torproject.org
Mon Jun 2 00:48:23 UTC 2014


#12170: Investigate performance issues surrounding count_usable_descriptors()
------------------------+------------------------------------------------
     Reporter:  nickm   |      Owner:
         Type:  defect  |     Status:  needs_review
     Priority:  normal  |  Milestone:  Tor: 0.2.5.x-final
    Component:  Tor     |    Version:
   Resolution:          |   Keywords:  024-backport tor-relay performance
Actual Points:          |  Parent ID:  #11332
       Points:          |
------------------------+------------------------------------------------

Comment (by nickm):

 Replying to [comment:4 arma]:
 > Re your patch, I think the change is fine. Two questions:
 >
 > First:
 > {{{
 > +    if (bool_neq(node->is_running, up))
 > +      router_dir_info_changed();
 > +
 >      node->is_running = up;
 > }}}
 > Why not put the assignment inside the if also, since we know it won't
 happen otherwise and it's clearer to say it? Or is it clearer to show that
 no matter what, afterwards the value of is_running will be the same as the
 value of up? This is a style question.

 I favor leaving it as it is, for clarity.  YMMV.

 > Second: in your commit message, "This patch makes us call it only when
 we have a router that we previously believed to be down, and we found it
 to be up." -- note that router_set_status() can be called with "up" false,
 meaning it's down, and I think your patch affects that side of the
 situation too (and it should).

 True, that would be more accurate.  I was thinking about the case
 mentioned in the commit, since that case was >99.9% of the calls in
 Andrea's profile

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/12170#comment:5>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list