1. A method, comprising: receiving a model in a technical computing environment, the model including a plurality of blocks and a plurality of lines, and the receiving the model being performed by a device; determining an application domain associated with the model, the application domain corresponding to a physical system, a component, a modeling pattern, or a region of operations associated with the model, and the determining the application domain being performed by the device; determining a plurality of code generation optimizations for the model, the determining the plurality of code generation optimizations being performed by the device; determining dependencies of the plurality of code generation optimizations, the determining the dependencies of the plurality of code generation optimizations being performed by the device; identifying an order for the plurality of code generation optimizations based on one or more of the application domain of the model or the dependencies of the plurality of code generation optimizations, the identifying the order for the plurality of code generation optimizations being performed by the device; generating optimal code for the model based on the identified order for the plurality of code generation optimizations, the generating the optimal code being performed by the device; and outputting or storing the optimal code, the outputting or storing the optimal code being performed by the device.