Avoid vector reallocation calls in WeightedChHashFuncBase::parseWeights - WDB cycles saving: 0.002%
Avoid vector reallocation calls in WeightedChHashFuncBase::parseWeights - WDB cycles saving: 0.002%

Summary:
From strobelight profiles, nearly 0.05% of capmond cycles can be attributed to calls to vector::push_back in WeightedChHashFuncBase::parseWeights https://fburl.com/scuba/strobelight_services/zj0szbu4

This ammounts to 0.002% of WDB cycles: https://fburl.com/scuba/strobelight_services/rhd2cvpx

A big chunk of that vector::push_back is normally vector reallocation. Vector reallocation happens when it reaches capacity and new elements are added, causing new memory to be  allocated and existing elements to be copied. To address this, I've made a call to std::vector reserve as we know the number of elements is going to be "n"

Reviewed By: stuclar

Differential Revision: D32679487

fbshipit-source-id: 9828d4466aa2d50e82e373d7b06305c4b8a9fa23

facebook/mcrouter,facebook/mcrouter,facebook/mcrouter,facebook/mcrouter