cmux: Refactor, test and improve performance of the circuitmux subsystem
The cmux subsystem (
src/or/circuitmux.c) is part of tor's fast path. It gets called at every cell or at every few cell and every new or dying circuit.
It is currently in our top 5 of CPU hugger (see legacy/trac#25152 (moved)) and also has a certain complexity to it. However, in practice, it should be quite simple. legacy/trac#25268 (moved) helps a lot by removing dead code and helping making the code more readable.
In order to improve that subsystem, there are few steps that need to be taken before we can address something like legacy/trac#25152 (moved). Furthermore, in order to fix some things in the scheduler (legacy/trac#23993 (moved)), this work should be done so we don't add more complexity to that code.
Refactoring this subsystem to something more simple also will help testing it for which right now, it is virtually untested (see
I'm taking this ticket because I do have planned out this work already and it might change over time.