Researchers say it is important to stay healthy and stress-free in your 20s for better cognitive health in midlife.

According to the findings of the latest study published in Neurology, adults with higher levels of inflammation in their 20s may experience reduced cognitive function in their 40s. Increased inflammation is associated with obesity, physical inactivity, chronic illness, stress, and smoking.

"We know from long-term studies that brain changes leading to Alzheimer's disease and other dementias may take decades to develop. We wanted to see if health and lifestyle habits in early adulthood may play a part in cognitive skills in midlife, which in turn may influence the likelihood of dementia in later life," said first author Amber Bahorik in a news release.

For the study, researchers tracked 2,364 adults who were part of the CARDIA study, which investigates factors in early adulthood that contribute to cardiovascular disease decades later. Participants, aged 18 to 30 at enrollment, were tested for the inflammatory marker C-reactive protein (CRP) four times over 18 years.

The researchers also conducted cognitive tests approximately five years after their last CRP measurement when most participants were in their forties and fifties. Approximately 45% had consistently low inflammation levels, 16% experienced moderate or increasing inflammation, and 39% had higher levels.

While they were tested for processing speed and memory, researchers noted that individuals in their 20s who had moderate or higher inflammation levels generally exhibited poorer performance compared to those with low inflammation. Specifically, the rate of poor performance was 10% among those with low inflammation, whereas it was 21% and 19%, respectively, for those with moderate and high inflammation levels.

After adjusting for factors such as age, physical activity, and total cholesterol, the researchers noted there were disparities in processing speed, and executive functioning, which includes working memory, problem-solving, and impulse control.

"Inflammation plays a significant role in cognitive aging and may begin in early adulthood. There is likely a direct and indirect effect of inflammation on cognition," said senior author Dr. Kristine Yaffe.

"Fortunately, there are ways to reduce inflammation – such as by increasing physical activity and quitting smoking – that might be promising paths for prevention," Yaffe said.