diff options
author | Nick Mathewson <nickm@torproject.org> | 2014-06-01 16:48:43 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2014-06-02 00:45:15 -0400 |
commit | ad8977e39461807dd04e34dc7fa3c12ccef0b62d (patch) | |
tree | 146b48d8abadabb94d1272017910f016d6e6c48b /src/common/mempool.h | |
parent | 8d9602c21ccc0d93c82c651d94791df88cf4c9ad (diff) | |
download | tor-ad8977e39461807dd04e34dc7fa3c12ccef0b62d.tar tor-ad8977e39461807dd04e34dc7fa3c12ccef0b62d.tar.gz |
Avoid needless router_dir_info_has_changed from router_set_status
On some profiles of Andrea's from #11332, I found that a great deal
of time can still be attributed to functions called from
update_router_have_minimum_dir_info(). This is making our
digestmap, tor_memeq, and siphash functions take a much bigger
portion of runtime than they really should.
If we're calling update_router_have_minimum_dir_info() too often,
that's because we're calling router_dir_info_changed() too often.
And it looks like most of the callers of router_dir_info_changed()
are coming as tail-calls from router_set_status() as invoked by
channel_do_open_actions().
But we don't need to call router_dir_info_changed() so much! (I'm
not quite sure we need to call it from here at all, but...) Surely
we don't need to call it from router_set_status when the router's
status has not actually changed.
This patch makes us call router_dir_info_changed() from
router_set_status only when we are changing the router's status.
Fix for bug 12170. This is leftover from our fix back in 273ee3e81
in 0.1.2.1-alpha, where we started caching the value of
update_router_have_minimum_dir_info().
Diffstat (limited to 'src/common/mempool.h')
0 files changed, 0 insertions, 0 deletions