Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Profiling is essential. I found a performance bug in calling some C++ functions a while ago, because they accepted a const std::string& and were being called in loops with a C const char*. Every single call had to construct a std::string involving a strlen, allocation and copy.

std::string_view is a nice fix for this but few programmers seem to use it yet.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: