Forty-thousand people from around the world have confirmed what many doctors have said for years: the optimum amount of sleep for everyone is 7 to 8 hours.

The results from the largest sleep study ever conducted were published Tuesday in the journal SLEEP.

Neuroscientists from Western University in London, Ont. asked participants to fill out questionnaires and a series of cognitive performance activities before and after sleeping.

"We really wanted to capture the sleeping habits of people around the entire globe," said Adrian Owen, Professor of Cognitive Neuroscience and Imaging at Western University.

"We were interested in looking at how prolonged lack of sleep affects people. How it affects your brain function, how it affects the decisions you're making from day-to-day."

People from 173 different countries were surveyed, the majority coming from the UK, Canada, the US and Portugal.

The golden amount of shut-eye

Over the course of approximately one year, beginning in June 2017, the study found that people who slept 7 to 8 hours per night performed better cognitively than those who got both more or less sleep.

"If you sleep too long, it's almost as bad as not getting enough sleep," Owen said, noting the majority of participants were not in that situation.

Most he said, were getting less than the optimal amount, clocking in on average at 6.4 hours per night.

"To me, that was the most astonishing thing!" Owen exclaimed.

So what happens when you don't get that golden amount of shut-eye?

"What was really problematic was decision making. Simple decisions like what time to set the coffee maker to get up in the morning, but also complex decisions like should I get married, should I write a will," said Owen.

Participants' verbal skills also took a hit, the study found, while short-term memory performance was relatively unaffected.

Age doesn't matter

Researchers were surprised when they were able to debunk a commonly-held belief that the amount of sleep needed lessens as a person ages.

According to the findings, that's not true.

"Older people, even those in their 70s and 80s who are getting 8 hours, are cognitively doing very well compared to their friends who are getting six."

On a positive note, the study did find that even one good night of sleep within the optimal timeframe can lead to improved cognition.

"The bounce back is actually quite quick. If you generally don't sleep 7 to 8 hours a night, if you can snatch a good night sleep at some point you are likely to be in much better shape the next day," Owen said.

Researchers did collect significant data on people who experience disrupted sleep, including parents with young children, as well as those who work shifts and "catch up" on sleep with naps.

"We've got all of that information and we'll be looking at it because we would like to know, for example, if a nap in the middle of the day is as good as a night's sleep."