We all have our good days and our bad days. Due to insufficient sleep, illness, stress, distractions, and many other causes we often find ourselves far below our usual levels of mental performance. When we find ourselves in such a state, it's not really worth putting effort in doing many tasks, like programming or long term planning - as quality will suffer a lot.
The problem is - other than observing deterioration of results, I have no idea if I'm in such a state or not. I cannot be sure if it's also true for others, but I had to find out a few tests of what's my mental performance at the moment. Tests that are deeply flawed, so I'd request better if there are any. I also cannot predict my mental state in advance, as my life isn't terribly regular.
The most reliable test I found, and by accident, was fighting bots on a certain Quake 3 map - me vs 10 or so highest difficulty bots. The challenge was to get 50 frags without dying. As the map was huge and full of power ups, it wasn't really that difficult as long as I could maintain full alertness for 10-15 minutes - but if I was tired or distracted, I would invariably fail. This test was unfortunately extremely slow.
Another test would be to go to goproblems, and do a few random problems at proper difficulty level. If I could think right, I would do most of them, if I was tired, I would fail almost 100%. This didn't test alertness, I guess it would be best described as short term memory test, as that's what used for game tree exploration. Unfortunately what's the proper difficulty varies a lot with how much go I played recently, so it needs to be recalibrated.
One more test would be to go to some decent online IQ test like this one. My results on such test would suffer a lot if I was sleepy or tired. The main problem is that such tests cannot repeated too often, or I'd just remember the answers.
So these are three ways to test how well my mind functions at the moment, all testing something different, and all flawed in one way or another.
How do you test yourself?
Sure. I should mention before hand that I wouldn't expect my results to generalize to anyone else. I started tracking my diet when I began having health problems and distinct cognitive impairment. I imagine the majority of the benefit I've achieved from diet has been due to correcting things wrong rather than improving things right. That said, here's a brief overview:
Foods that rapidly bring on brain fog, degree dependent on quantity: Raw carrots, raw bell peppers, peanut butter, walnuts, pure sugar (even natural sources, such as sugarcane, but tentatively not honey), bananas, raw apples, enriched grains (tentatively, I've only tried this experiment half a dozen times), tofu.
Whether the food is cooked or not seems to matter, but I've only experimented with this for a handful of foods.
Among the foods I do eat I prefer those that provide an even level of energy over time, to avoid crashes: lean protein, oats, olive oil, non-starchy vegetables; however, there are foods/drinks that provide positive cognitive benefit in the short run, such as: some alcoholic drinks, starchy vegetables (yams, sweet potatoes), coffee, mint tea.
For the sake of simplicity in analysis I almost always restrict my meals to 4-5 ingredients, and almost never eat out.
It still might generalize a bit if others have the same things wrong. I'd be interested to hear what sort of back story you have to make this a bigger problem for you.
I'll try to pay attention when eating those sorts of foods and see if I notice anything different.