Describe the bug
I'd expect a call to map / set :: reserve to preallocate the memory of the m_values vector.
Right now it does not happen - if I add a blanket m_values.reserve(capa) in there, I immediately get a few % improvements - for instance, for an input of ~100k strings (every filename in /usr/include), I get
insert: 5148us (inserting the 100k elements)
find: 4740us (finding every individual element in a random order)
while if I add the call to m_values.reserve in map::reserve, I get:
Describe the bug I'd expect a call to map / set :: reserve to preallocate the memory of the m_values vector. Right now it does not happen - if I add a blanket
m_values.reserve(capa)
in there, I immediately get a few % improvements - for instance, for an input of ~100k strings (every filename in /usr/include), I getwhile if I add the call to m_values.reserve in map::reserve, I get: