Starbucks (SBUX 1.00%) and McDonald's (MCD -0.05%) both announced earnings results last week. Though the coffee titan set a new quarterly profit record and gained market share, its business was outshined by Mickey D's in a few key operating metrics.

Let's take a closer look at how the fast-food giant is beating Starbucks as a growth investment right now.

Friends sharing a fast-food meal.

Image source: Getty Images.

Better traffic growth 

Starbucks has trounced McDonald's in its growth pace over the past few years, with comparable-store sales up 5% in 2016, 7% in 2015, and 6% in fiscal 2014. The fast-food king's comparable annual figures were 4%, 1.5%, and negative 1%.

The gap has reversed lately, though. McDonald's posted a 7% comps spike in its most recent quarter while Starbucks' pace was just 4%.

The Golden Arches achieved that impressive result the hard way, too: through increased traffic. Guest counts are up 2% over the past six months, compared to a 1% decline for Starbucks since its fiscal year started nine months ago.

Higher margins

Both companies enjoy industry-leading profitability, but McDonald's easily wins this head-to-head matchup. Operating margin has soared to 37% of sales so far this year from 30% over the same period in 2016. In contrast, Starbucks' figure recently fell by a percentage point to 18% of sales. Stripping out the one-time charge from Teavana mall store closures still leaves the coffee specialist far below McDonald's impressive operating margin.

MCD Operating Margin (TTM) Chart

MCD Operating Margin (TTM) data by YCharts.

McDonald's has a clear path toward future records here, too. It is pushing its company-owned restaurant base lower by selling locations to franchisees. That shift is making highly profitable rent, fees, and royalties a greater proportion of its sales base. Essentially, the company is trading slightly lower revenue for much higher profit margins. And, because the revenue base is rising, too, earnings are being supercharged in the process.

Hitting those targets

Starbucks just lowered its sales growth outlook and now sees revenue rising by 8% in fiscal 2017 to put it well below the long-term plan it announced late last year. That prior forecast had predicted 10% sales gains as earnings improved by between 15% and 20% each year until 2021.

Coffee cups.

Image source: Getty Images.

Investors are also bracing for surprisingly sluggish profit gains as non-GAAP earnings rise to between $2.05 per share and $2.06 per share, translating to growth of just between 12% and 13%.

McDonald's business meanwhile is running ahead of management's schedule. In the rebound plan it announced in March, the fast food titan had targeted sales growth of between 3% and 5% and operating margin of roughly 45% of sales by 2019. Executives also expected annual earnings per share to rise in the high-single-digit range over the long term.

The company trounced those revenue and earnings targets this past quarter and is making strides toward its aggressive profitability goal. Most importantly, menu tweaks, store remodels, and new product launches appear to have stopped the market share slide that executives saw as central to their operating stumbles. "We're building a better McDonald's and more customers are noticing," CEO Steve Easterbrook told investors in late July.

Starbucks executives, on the other hand, were surprised by slowing growth in their core market lately. Three months ago, CEO Kevin Johnson said the team was "confident that we've turned the corner on U.S. [comparable-store sales]." Yet in their latest conference call with Wall Street analysts they cited "stiff consumer and industry headwinds" that convinced them to lower their expectations even as McDonald's sees an opening to build on its positive momentum.