I wrote a more object-level detailed answer about tools and getting better at common tasks, but those are just side issues.
If you're tired, you will fuck things up. Fucking things up is much slower than doing it right the first time.
Similar reasoning for eating well. I'd also recommend intermittent fasting - the kind of biological effects that digesting food causes aren't good for thinking well. Plus, breaking for lunch in an interruption, and not eating lunch is a good way to side-step that.
Working fewer hours is the easiest way to get faster. Pretty much everyone gets slower at programming later in the day. If you simply don't try to force yourself through your least productive hours, you're going to be faster on average.