4.5.5 How Can I Make My Code Faster?

Try the following suggestions for faster code execution:

  1. Smaller code can be faster code. Reducing the number of machine instructions that are necessary to perform a task will result in faster execution of that task. For details on making smaller and faster code, see the following sections of this user’s guide:

    4.5.3 How Can I Make My Code Smaller?

    4.5.8 How Can I Make My Interrupt Routine Faster?

  2. You can use increasing optimization levels to generate faster code while considering speed vs. size trade-offs. For details, see the following chapter and section of this user guide:

    19 Optimizations

    6.7.6 Options for Controlling Optimization

  3. Algorithm choice has more impact on size and speed of your solution than any other factor. Choose the right algorithm for the job.