perf: minor improvements in parse function#927
Conversation
app/src/cli/cli.hpp
Outdated
|
|
||
| try { | ||
| std::vector<std::string> params; | ||
| params.reserve(2); |
There was a problem hiding this comment.
For the -engine option we must specify at least two parameters (cmd and name). Without reserving, pushing these would trigger two allocations (size 0 → 1, then 1 → 2) because GCC’s std::vector typically doubles capacity on growth. Other options like -pgnout or -openings can have more parameters, so we might want to increase the reserved size accordingly.
@Disservin thoughts?
|
this is really not performance important code, im happy to merge the map -> unordered change but dont think we need to start reserving memory right now |
|
Sure, @Disservin . I have reverted the reserve code. On a separate note, do you have any features/code improvements in mind? I am currently learning C++ and would love to make some more contributions. |
No description provided.