There's two problems here; the theoretical maximum and the humanly feasible maximum. For the theoretical max, check the "Food per hour" metric on the Treat Farms wiki page. It also shows you the cost per food; note that the longer the grow time, the less efficient the food/hour and food/money metrics get.
The cheapest foods actually produce the most food in the least time and for the least cost (an exception below). However, it's not humanly possible to sit at the game and harvest Dragonsnaps every 30 seconds.
Instead you should just plan your food growing based on how long you'll be away from your game. When you start out, you'll probably be playing actively and pick very quick-growing food. As time goes on you'll check the game less and prefer Pumpermellons for the 8 hour time; if you only check the game once every 8 hours, Pumpermellons are suddenly the most efficient.
Also remember to always build a new treat farm immediately when you can at level up; you can even buy the cheapest one and upgrade later. Since there's no build time, buy the cheapest one you can afford, as it still lets you farm more. Every level up, check and see if you can build another treat farm.
There's a late game exception however; once you upgrade your farms a second time to the Huge Treat Farm, you get very high-cost, short grow time treats. These foods all grow in an hour or less, and cost exactly 50 gold per food and give large volumes of food in very stort times. It's basically converting your money straight into food, bypassing (most) of the growing time problem. These are the least cost efficient, but once you have millions of Cash, you'll prefer it to manually growing all the time.