a month ago
- Modern C++ compilers (like Clang and GCC) can produce optimal code from naive implementations, making many old performance tricks obsolete.
- Fast inverse square root, once a clever optimization for old CPUs, is now comparable to naive implementations thanks to compiler and hardware advances.
- Standard library features like <bit> for popcount, ranges, and algorithms offer clear, portable code that often matches or beats hand-optimized versions.
- Error handling with std::expected outperforms exceptions for expected failures, while exceptions remain suitable for truly exceptional cases.