robocup-software icon indicating copy to clipboard operation
robocup-software copied to clipboard

Reserve space in vectors before calling push_back

Open kylestach opened this issue 5 years ago • 0 comments

As an easy optimization, in lots of places we push back into a vector without first calling reserve (even though we usually have at least a good lower bound on how many items we'll need.

For example: https://github.com/RoboJackets/robocup-software/pull/1494/files/1d6b526aaeada2dc275fe30c3e2316de4e177dd9#diff-dfa0f461b7c683261fb993e66180bc72R39

Brought up in review of #1494.

kylestach avatar Jun 14 '20 06:06 kylestach