Hacker News new | ask | show | jobs
by fractaled 592 days ago
It's hard to know how to take this given that their first example (function call overhead) seems deeply flawed -- you'd never have a 'compare' strings function take std::string by value. (Maybe const string& or string_view). Also, the alternative would have to have a destructor of some type (unless it is a string_view analog) to make it an apples to apples comparison.
1 comments

the entire article rests on a shorter String that can be fit on registers reliably. If you have bytes in registers, it is not clear that passing bytes by value is "deeply flawed."
You'd never have a `compare(std::string a, std::string b)` function in your code base. It would make copies of the strings (and destroy them). So it seems to me the article is comparing their new thing to a straw man.