McDonald's (NYSE:MCD) shares shot to a new high this week, following the fast-food titan's strong second-quarter earnings report. That spike sent the stock up over 30% in 2017 to make it one of the best performers in the Dow so far.

Let's zero in on a few of the metrics that have Wall Street once again feeling optimistic about this iconic burger business.

Friends eating fast food in a mall.

Image source: Getty Images.

6.6%: Comparable-store sales growth

Mickey D's managed an almost 7% bounce in comparable-store sales to mark a solid improvement over the prior quarter's 4%. In fact, it was the company's best growth performance in over five years. 

Sales gains picked up nicely in the core U.S. market, where comps soared to a 3.9% pace from 1.7%. The boost cleared up the concern that McDonald's would struggle to keep growing following last year's launch of all-day breakfast offerings. Key menu drivers this time around included a popular cold beverage promotion and the launch of its premium sandwich platform.

1.8%: Guest traffic gain

Looking deeper into that comps number, investors saw an encouraging uptick in customer traffic that implies the sales boost might just be getting started. McDonald's has been struggling with declining guest counts for years. Traffic ticked lower by 0.3% globally in 2016 -- including a 2% plunge in the United States. The drop forced executives to admit to a sinking position in the industry. "As customers' expectations increased," CEO Steve Easterbrook told investors in early March, "McDonald's simply didn't keep pace with them."  

A man enjoys a burger.

Image source: Getty Images.

Yet the company enjoyed rising counts this quarter across each of its geographic divisions. Over the first six months of the year, traffic was up 1.8%, compared with a 0.3% gain in the prior-year period. "We're building a better McDonald's, and more customers are noticing," Easterbrook explained this week.

12%: Decline in expenses

McDonald's sliced $71 million out of its expense base, and the 12% decrease outpaced the 3% decline in overall revenue this quarter. Investors can thank a cost-cutting program for part of that profitability improvement.

Mickey D's also got a large contribution from a refranchising initiative that's shifting more operating costs to franchisees. For the full year, management expects to lower expenses by between 7% and 8%. 

82.3%: Franchised restaurant margin

Profit margin for its army of franchised locations improved to 82.3% from 81.7%, which powered a 6% spike in operating income for the group. Profitability fell slightly in the U.S. thanks to rising labor costs. However, the dip was more than offset by bigger gains elsewhere, especially in Japan.

A broader operating margin, lifted by franchise fees and rent charges, continued to impress, as it jumped to 38% of sales.

19%: Adjusted earnings growth

Core earnings are up 19% over the past six months even though revenue has dipped by 4%. McDonald's is growing more efficient as it converts additional company-owned locations to franchised operations. Since these franchises are far more profitable but deliver lower revenue, the fast-food giant faces a trade-off between top-line growth and earnings.

MCD Operating Margin (TTM) Chart

MCD Operating Margin (TTM) data by YCharts

Easterbrook and his team like the terms of that deal and so are planning to push the share of company-owned locations down to 5% over time from 15% today. They plan to finish selling off 4,000 locations to franchisees this year and then rely more heavily on that model when expanding the store base.

As for longer-term growth, McDonald's is spending $1.7 billion on capital investments this year, to be split between restaurant launches and remodeling plans that include adding technology such as ordering kiosks while rolling out a national home delivery service.

This article represents the opinion of the writer, who may disagree with the “official” recommendation position of a Motley Fool premium advisory service. We’re motley! Questioning an investing thesis -- even one of our own -- helps us all think critically about investing and make decisions that help us become smarter, happier, and richer.