Optimization is dependent on the technical aspect of the implementation. Ultimately, it is going to be a computer that's going to execute the program and it has its own constraints. Reconciling the domain and the execution platform is where the programmer expertise comes in.
Disagree with "naturally". Unless you want to end up on accidentally quadratic. Or on accidentally exponential if there's such a list.