Retailers are doing everything they can to woo millennials -- the generation that's now in its 20s and 30s. This cohort is becoming an increasingly vital source of demand as its members' disposable income catches up to that of baby boomers. However, some retailers are doing better than others. According to a research note by Goldman Sachs,  Starbucks (SBUX 0.63%) and Dunkin' Brands (DNKN) are especially popular among millennials, while old-guard stalwart McDonald's (MCD -0.47%) lags far behind.

Millennials' product preferences
Contrary to popular perception, the restaurant industry is fairly robust. At least as far back as the 1980s, restaurant sales have remained just below 3% of U.S. gross domestic product. This suggests that consumer demand for restaurants is stable, even if it fluctuates with gross domestic product.

Sources: U.S. Department of Agriculture, MeasuringWorth.com.

However, intuitively we know that the restaurant industry is extremely competitive. Countless headlines about fast food breakfast wars and restaurants using mobile technology to get a leg up on the competition reminds us of the brutal realities of competing in the restaurant industry. Consumer demand for restaurants is stable, but their preferences constantly change.

Unfortunately for McDonald's, new research from Goldman Sachs suggests millennials prefer premium coffee and croissants from Starbucks to burgers and coffee from McDonald's. The bank surveyed 2,000 U.S. consumers and ranked restaurant chains by the percentage of millennials who were aware of a chain and had visited it within the past year. Starbucks was the No. 1 restaurant in the survey. Dunkin' Donuts was fifth on the list, behind Domino's, Papa John's, and Chipotle Mexican Grill. However, McDonald's was third from last, with just over 2% of millennials visiting. It even finished behind Potbelly, a regional sandwich chain.

The survey revealed the reason for McDonald's poor showing: Compared with the overall population, millennials have a strong preference for pizza, coffee, and fast-casual concepts (like Chipotle), but have a smaller preference for fast-food burger chains like McDonald's.

What it means for your investments
As baby boomers retire and millennials move up in their careers, the next generation's spending power will become the most powerful force in retail. Starbucks and Dunkin' Donuts have a huge advantage in that this key demographic clearly favors their products, but McDonald's must adapt to the changing consumer environment.

Millennial's importance to restaurant chains may be why McDonald's is making coffee-driven visits a top priority, taking direct aim at Starbucks and Dunkin' Donuts. McDonald's is even going so far as to give away coffee for the first two weeks of April. The move is designed to drive customers during the morning daypart and make McDonald's coffee a habit for consumers around the United States.

Unfortunately, McDonald's is unlikely to ever compete with Starbucks in a manner that will drive millennial traffic through its doors. Starbucks is a place where young people can relax for an hour or two; McDonald's is a place people either order to-go or stay only for the 10 or 15 minutes it takes to eat a meal. McDonald's may drive up its average ticket price by pairing coffee with its breakfast offering, but few Starbucks customers are going to switch to McDonald's coffee just because the price is lower; McDonald's can never replicate the Starbucks Experience and the culture that surrounds the brand.

This may explain why Starbucks' U.S. comparable-store sales continue to grow at mid-to-high single digits each year, while McDonald's struggles just to maintain U.S. sales.

Takeaway
As the millennial generation grows and prospers, its spending power will choose winners and losers in the restaurant industry. Starbucks and Dunkin' Donuts face a long-term secular increase in demand for their products, while McDonald's faces a long-term secular decline in demand. The effects are already becoming clear, as McDonald's struggles while Starbucks and Dunkin' Donuts continue to grow. As a result, investors should carefully consider millennials' impact on long-term demand before choosing a restaurant stock.