| > I really don't get this argument. If you don't need pedal-to-the-metal performance then why are you using C++ in the first place? (Unless, of course, your answer is "legacy code".) There is many other things that pure compute-bound CPU performance that can drive you to a GC-less language like C++. Fine grain memory usage is one of them, latency control is an other. > `std::regex`'s performance is bad. , `std::unique_ptr` doesn't optimize as well as a plain pointers std::regex is not defendable, specially when there is much better implementation already available (https://github.com/hanickadot/compile-time-regular-expressio...) However, do you have any bench / source for std::unique_ptr ? You are the first one I hear giving critics on it. > Do you, though? Rust already replaced their standard hash map implementation with a completely different one which was faster, so it shows that it can be done. Rust does not have 25 years of code base behind him. We can talk to that again when he gets 10 years more. C++ can not afford to randomly break API on one of its core STL component just to hypothetically gain few bit of performance. It can be done, but it should be done with a depreciation process and an alternative implementation, like it has been done for auto_ptr -> unique_ptr. |
And so they did exactly what you say, for that reason. std::unordered_map is a better comparison.