You wake up in the morning and are famished. In order to have strength to go to Shul you need to eat prior to Davening. However, if you were to Daven without a Minyan at home you would not have to eat prior to Davening. What should you do? Eat before Davening with a Minyan? Or Daven without a Minyan and avoid eating before Davening? (sources please)
Your question is addressed in a Biur Halacha O.C 89 "v'chen". A person who is eating for strength (because he experiences weakness) may eat before davening even if he could just as easily waited until after davening- since his intent is for his health.
However, he continues quoting, the best practice is to not eat before davening, even if this will disallow him from davening with a minyan because of his weakness.
I would qualify this with the assumption that davening first and eating later would not have an effect on his attention. If it does, perhaps we would defer to the Aruch haShulchan 89:25 quoting the Rambam that you must eat, and the Bais Yosef saying that it is optional (presumably because we don't have great attention anyway).
Hayom Yom (compiled by the Lubavitcher Rebbe from talks by his Father in Law, the previous Rebbe) says:
When my grandmother, Rebbetzin Rivka, was eighteen (in 5611, 1851) she fell ill and the physician ordered her to eat immediately upon awakening. She, however, did not wish to eat before davening; so she davened very early, then ate breakfast. When her father-in-law, the Tzemach Tzedek, learned of this he said to her: "A Jew must be healthy and strong. The Torah says about mitzvot, 'Live in them,' meaning bring vitality into the mitzvot. To be able to infuse mitzvot with vitality, one must be strong and joyful." Then he concluded: "You should not be without food. Better to eat for the sake of davening rather than to daven for the sake of eating;" he then blessed her with long life. [She was born in 5593 (1833) and passed away on Sh'vat 10, 5674 (1914)].
My father told this teaching of the Tzemach Tzedek to someone at yechidus, adding: "And this must be done with joy."
There is no issue (from either the point of view of the doctors and from the point of view of the Torah) to wake up early and daven then (maybe a loss of a bit of kavanah). Yet, the Tzemach Tzedek still told her to wake up on time and eat in the morning. Therefore, it is better to eat before davening and to daven properly than to not eat before davening and to daven improperly.
wake up earlier so you don't feel so hungry, you may drink water, tea or coffee before shaharit and that's it. it like someone asking if it's better to eat nevelot or terefot, you shouldn't do neither.
even bediavad, if you suddently find yourself in this situation, just man up and go to the synagogue, you won't die, faint or get sick because you ate an hour later (even less if you compare the time difference between praying with the minian and alone)