This kind of code does not tend to be rigid as you might imagine. Quite the opposite. Since it doesn't introduce a ton of premature abstractions and stays straight to the point, it tends to be flexible and easy to change/adapt.
You are still thinking in terms of a false dichotomy:
- Flexible but slow
- Fast but rigid
But it's a false dichotomy.
You don't need optimizations to get high performance software. Computers are very fast. You just need non-pessimized code.
It's funny. People use "computer are very fast" to dismiss all performance concerns. But this is not how we should think about it.
"Computer are very fast" means we don't need to optimize (as in micro-optimize on the instruction level) code to get high performance. We just need to get the clowns out of the car.