Caffeine is a fascinating substance. Its effects vary depending on whether you are a regular coffee drinker and if you are, whether you have abstained for a few days. One of the very early studies on caffeine maybe 20 years ago was eye-opening to me. (There are lots of newer studies now.) It found that 85% had no statistically significant benefit and some of those were actually worse. However, in the 15% that did benefit, about half improved their time to exhaustion from 60 to 90 minutes! That's a stunning 50% improvement! It's no wonder that virtually all cyclists swear by coffee.
If you look at the details in caffeine studies, you'll find some studies have a wide range of responses.
What this means is that you need to test yourself and see what works. Preferably, you do the testing on hard days or time trials. You don't wait until the day of the big race to try it for the first time.
I drink 1-2 cups of coffee every day. Before a hard workout or race, I'll take a half tab of caffeine (100mg). A full tab makes me jittery. I'm not sure that it helps performance, but it helps my alertness and mental acuity while running.