Iterative or Innovative? A Problem-Oriented Perspective for Code Optimization