If I am not training I have the capacity to easily fast, not issue at all with fasting, not because I follow any intermittent fasting diet, just it is the way it is. Only sample=1 but I never observed any special enhanced cognition doing that while I observe an enhanced cognition function with very basic things like sleeping well.
One more thing, I also find an improvement in cognition more with running than with swimming or biking. There are many studies about that but I give my personal experience not trying to give any conclusion for everyone. YMMV.