(Health.com) -- Sleep has long been known to improve performance on memory tests. Now, a new study suggests that an afternoon power nap may boost your ability to process and store information tenfold -- but only if you dream while you're asleep.

"When you dream, your brain is trying to look at connections that you might not think of or notice when [you're] awake," says the lead author of the study, Robert Stickgold, the director of the Center for Sleep and Cognition at Beth Israel Deaconess Medical Center, in Boston, Massachusetts. "In the dream...the brain tries to figure out what's important and what it should keep or dump because it's of no value."

In the study, Stickgold and his colleagues asked 99 college students to memorize a complex maze on a computer. The researchers then placed the students inside a virtual, 3-D version of the maze and asked them to navigate to another spot within it. After doing this several times, half of the participants took a 90-minute nap while the other half stayed awake and watched videos.

Health.com: What's keeping you awake at night?

When the students were given the maze test again five hours later, the nappers did better than the students who had stayed awake, even those who had reviewed the maze in their heads. However, the nappers who dreamed about the maze -- one described being lost in a bat cave -- performed 10 times better than the nappers who didn't.

The students who dreamed about the maze did poorly on the test the first time around -- which may not be a coincidence, the researchers say. If a task is difficult for you, your brain seems to know it, and you may be more likely to dream about it than if the task were easier.

"If you're not good at something, and you dream about it, you seem to get better at it -- especially if the information can be used in different situations," says Michael Breus, the clinical director of the sleep division for Arrowhead Health, in Glendale, Arizona, who was not involved in the study.

"The sleeping brain seems to be processing information on one level, but on a higher level it helps evolve your memory network if the information is relevant or helpful in your life experience," adds Breus, who is also the author of "Beauty Sleep."

The study's findings, which appear in the journal Current Biology, underscore just how important sleep is to our memory and mental function.

Health.com: 8 natural remedies that may help you sleep

It doesn't even need to be a deep sleep, as the researchers found when they monitored the brain activity of the students while they slept. Although the deep slumber known as rapid eye movement (REM) is most closely associated with dreaming, the students' dreaming and learning occurred after as little as one minute of non-REM sleep.

Health.com: Turn your bedroom into a sleep haven

The type of learning that occurs while you dream can be illustrated by the classic dream that many people have in which they show up for an exam that they haven't studied for, Stickgold says.

"When you're in school -- especially college -- there's this ongoing sense that you haven't done enough," he says. "Maybe you didn't make it to a lecture, or you had a paper due in three days that you hadn't started, so you're laying down memories that say, 'I haven't done anything that I need to do.'"

When someone has the exam dream (or nightmare), he says, "Your brain is taking the knowledge of what happened to help you behave differently in the future."

You may be able to harness the dream power displayed in the study to perform better in your everyday life, Breus says.

Health.com: How to sleep easier and avoid midday fatigue

"If you're studying something tough, get the basics down and take a nap. If you dream about it, you will probably understand it better," he says. "Or, go to bed a little earlier the night before, wake up early, review the material, and then take a quick nap to solidify your understanding."

That's good advice, says Dr. Rafael Pelayo, an associate professor of sleep medicine at Stanford University School of Medicine, in Palo Alto, California.

"Instead of cramming, study intensely, catch a nap, and then maybe do some more studying," he says. "A nap may be a good tool to enhance your ability to remember information."

Health.com: How to cope with less sleep at work