Image source: McDonald's.

McDonald's (MCD -0.05%) stock has rewarded shareholders handsomely over the years, but there comes a time when even once-lucrative stocks have overstayed their welcome in a prudent investor's portfolio. McDonald's is, at the very least, approaching this point.

Shares of the burger giant have increased steadily over the past year, up by 25%. That outpaces even some of the most widely held stocks in the restaurant industry. Shares of Starbucks (SBUX 1.00%) are up 7% over the past year, while shares of Yum! Brands (YUM 1.22%) are down by 10%.

The net result is that McDonald's shares are now trading within spitting distance of their 52-week high, off by only 7%.

MCD Chart

MCD data by YCharts.

This performance is counterintuitive when you consider that McDonald's earnings per share have been trending down, not up. The figure has dropped by an annual average of 3.6% over the past three years, according to YCharts.com. Starbucks, by contrast, has seen its average annual earnings per share grow by 26.7% over the same stretch.

That alone doesn't mean that McDonald's shares are overpriced. It's possible that the future could look brighter for the burger chain than the recent past. This is particularly true when you consider that McDonald's has taken steps recently to reinvigorate growth, rolling out all-day breakfast in the United States and doubling down on restaurant openings in China.

To get a sense for whether its shares are reasonably priced, then, one must look at its price-to-earnings ratio. This is calculated by dividing a company's share price by its earnings per share. A higher ratio signifies a dearer price, while a lower number suggests that a bargain might be at hand.

McDonald's P/E ratio is 23.7. This isn't unreasonable by any stretch of the imagination. The average P/E ratio on the S&P 500 is 24.1, which is higher than McDonald's. And shares of Starbucks and Yum! Brands trade for 32.6 and 27.2 times earnings, respectively.

But the difference is that McDonald's isn't expected to grow its earnings per share as quickly as either of these competitors. While Starbucks and Yum! Brands earnings per share are projected to grow by 17% and 11%, respectively, annually over the next two years, analysts think that McDonald's per-share earnings will increase by an annual average of 10%.

The interplay of McDonald's current valuation with its growth prospects is reflected in the PEG ratio, which provides a more complete picture of a company's valuation than the P/E ratio. The lower the PEG ratio the cheaper the stock, with a ratio of 1.0 signifying fair value.

This is where it becomes clear just how overpriced McDonald's shares seem to be. Its PEG ratio is 2.17. That's well in excess of the fair value threshold of 1.0, as well as Starbucks' PEG ratio of 1.82 and Yum! Brands' 1.28.

It's possible that McDonald's fundamental performance will exceed expectations and grow into this valuation. At the same time, however, given the maturity of McDonald's business, one would be excused for concluding that there are greener pastures elsewhere, even in the restaurant industry itself.