From 06e8370c33d6ccb73d55e9e8c3d2673c48d7b328 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Sat, 12 Dec 2009 00:49:48 -0500 Subject: Optimize cell-ewma circuit priority algorithm. There are two big changes here: - We store active circuits in a priority queue for each or_conn, rather than doing a linear search over all the active circuits before we send each cell. - Rather than multiplying every circuit's cell-ewma by a decay factor every time we send a cell (thus normalizing the value of a current cell to 1.0 and a past cell to alpha^t), we instead only scale down the cell-ewma every tick (ten seconds atm), normalizing so that a cell sent at the start of the tick has value 1.0). --- src/or/config.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/or/config.c') diff --git a/src/or/config.c b/src/or/config.c index fe5fe9f7ee..a22ec4b13d 100644 --- a/src/or/config.c +++ b/src/or/config.c @@ -1379,6 +1379,9 @@ options_act(or_options_t *old_options) if (accounting_is_enabled(options)) configure_accounting(time(NULL)); + /* Change the cell EWMA settings */ + cell_ewma_set_scale_factor(options); + /* Check for transitions that need action. */ if (old_options) { if (options->UseEntryGuards && !old_options->UseEntryGuards) { -- cgit v1.2.3-54-g00ecf