One study has made an analysis of the effects of caffeine on cognitive performance. See: https://libres.uncg.edu/ir/uncw/f/lothesj2004-2.pdf
I didn't read the whole study but it seems that has tested with coffee capsules, placebos and beverages with different amounts of coffee. The results are not totally clear even for the author.
Although it is likely that caffeine in beverage form did have time to reach a peak
levels of absorption and might be an explanation for why the 2mg/kg caffeine coffee
group scored higher than the caffeinated capsule groups, it still does not help to explain
why the decaffeinated coffee group also scored better than most of the capsule groups*.
Nor does it explain why performance on the second task in this study did not produce
significant effects since better caffeine absorption should have occurred.
*Highlighted by me
An interesting point that he remarks in conclusions is the diversity of results in many studies and why could that happen.
Many studies of caffeine effects on cognition have been conducted. However,
these studies have produced mixed results. One potential reason for these conflicting
results is because mixed procedural standards have been used, and in some cases they
lack control over critically relevant variables
Anyways, this is a good study that can point you to the right direction. The study mentions many other studies that can also be interesting.
I need to say that I couldn't find the name of the author or a reference page, only mention of other studies (I didn't search so much...)