On each parsed command send by clients a new dispatcher object would
have been created to be thrown away right when the command has been
executed. This was a bit suboptimal, although easier to implement.
This MR creates a single dispatcher object and will return a reference
to the handler function based on the command to be executed. Having a
single object, shared for all connections is far more efficient and
also required to gather metrics.
On each parsed command send by clients a new dispatcher object would have been created to be thrown away right when the command has been executed. This was a bit suboptimal, although easier to implement.
This MR creates a single dispatcher object and will return a reference to the handler function based on the command to be executed. Having a single object, shared for all connections is far more efficient and also required to gather metrics.