Do you lie awake for what seems like eternity before drifting off to sleep? Toss around in an unsettled stir throughout the night? Or do you conk out quickly and stay nearly comatose until morning, when only a blaring alarm clock can get you vertical – and that's after hitting the snooze button three times? Millions of Americans struggle with sleep in some shape or form, whether it's getting too little or too much, and both can have negative health consequences. Inadequate rest can raise your risk of obesity, diabetes, depression, and heart disease, while perpetually oversleeping is linked to shorter lifespans, says Michael Grandner, a researcher at the University of Pennsylvania's Center for Sleep and Circadian Neurobiology.

Whether you crave sounder slumber or an easier wake-up, you might want to take a hard look at your diet. A first-of-its-kind study published in the journal 'Appetite' found concrete links between particular nutrients and sleep duration in a large survey of adults. Although previous research has connected diet and sleep, most studies have been done in controlled, sterile sleep clinics over a few weeks' time, but this one examined participants' real-life sleep patterns for a full year.

Grandner and his team grouped participants by average sleep duration: normal (seven to eight hours), long (nine or more hours), short (five to six hours), and very short (less than six hours). Then when they looked at participants' nutrient intakes, they found some striking similarities within each segment.

First off, the normal sleepers had the widest variety of nutrients, which indicates they're eating the overall most healthful diets, says Grandner. Very short sleepers had the narrowest nutrient range, which could mean their sleep-deprived brains are making poor food choices or they're eating the same unhealthy snacks day after day, he explains.

Digging deeper, very short sleepers consumed fewer total carbohydrates and got less lycopene, a nutrient abundant in tomatoes, carrots, bell peppers, and other red and orange foods. As for short sleepers, they lacked vitamin C and selenium, a mineral found in fish, seafood, turkey, and barley, but had more lutein and zeaxanthin, phytonutrients found in leafy, green vegetables. Finally, long sleepers were low in theobromine, a chemical in chocolate and tea, along with lauric acid, a not-so-bad-for-you saturated fat in coconut and palm oils, and choline, a vitamin in eggs, poultry, grass-fed beef, and some salad greens. Long snoozers also took in fewer total carbs but drank more booze.

That's a dizzying number of nutrients to remember. Luckily, though, Grandner says you shouldn't get too hung up on individual ones – yet. Since these findings are preliminary, he says it's still too early to definitively say things like "Short on sleep? Eat more tomatoes" or "Want to cut slumber time to eight hours? Chow down on chocolate."

Rather, the takeaway here is that when it comes to sound sleep, diet does matter, maybe more than previously thought. And all signs point to eating a wide variety of foods rich in essential vitamins and minerals as one of the best ways to ensure a good night's rest. So if you're consistently sleep deprived or needing a kick in the pants to start your day, that's all the more reason to skip the frozen pizza and pancakes and start mixing in more salads, fresh fruit, and lean meats.