Make your code do less work.
Use less memory so more of your code/data fits in the CPU cache.
Understand the algorithms that you use, their strengths and weaknesses.
No magic tricks, just hard work.