Skip to content

Commit

Permalink
storage_proxy: place unique_response_handler:s in small_vector instea…
Browse files Browse the repository at this point in the history
…d of std::vector

This cuts an allocation in the write path. Instruction count reduction isn't
large, but performance does improve (results are consistent):

before: 196369.48 tps ( 55.2 allocs/op,  13.2 tasks/op,   51658 insns/op)
after:  199290.32 tps ( 54.2 allocs/op,  13.2 tasks/op,   51600 insns/op)

(this is perf_simple_query --write --smp 1 --operations-per-shard 1000000)
  • Loading branch information
avikivity committed May 9, 2021
1 parent b015ded commit dd904f7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion service/storage_proxy.hh
Expand Up @@ -66,6 +66,7 @@
#include "cdc/stats.hh"
#include "locator/token_metadata.hh"
#include "db/hints/host_filter.hh"
#include "utils/small_vector.hh"

class reconcilable_result;
class frozen_mutation_and_schema;
Expand Down Expand Up @@ -199,7 +200,7 @@ private:
~unique_response_handler();
response_id_type release();
};
using unique_response_handler_vector = std::vector<unique_response_handler>;
using unique_response_handler_vector = utils::small_vector<unique_response_handler, 1>;
using response_handlers_map = std::unordered_map<response_id_type, ::shared_ptr<abstract_write_response_handler>>;

public:
Expand Down

0 comments on commit dd904f7

Please sign in to comment.