Optimization examples
"If you pass that by value one more time..."
Move semantic (TODO).
Return value optimization (TODO).
std::vector<> is your best friend
"I have learnt linked-lists at university, should I use them?" Nooope.
You don't need a std::map<> for that (TODO).
Small vector optimization (TODO).
"It is just a string, how bad could that be?"
String concatenation: the false sense of security of std::string::operator+ (TODO).
std::string_view: love at first sight (TODO).
Don't compute things twice.
Example: 2D/3D transforms the smart way (TODO).
Double for-loop: less elegant, more performant version (TODO).
Fantastic data structures and where to find them.
github地址:https://github.com/facontidavide/CPP_Optimizations_Diary