Space your meals evenly
If you go more than three hours since you have eaten, it is not a good idea to hit the gym. Even if you had the most nutritious meal ever, you would not be at your peak.
The key is to have a full meal three to four hours before exercising. Then, a small pre-workout snack that is easy to digest, like half a banana or a pretzel.