Source: Wikimedia Commons

Heading into earnings, some investors are probably wondering what to make of Costco (COST 1.01%). With its shares trading at $114.94, around the middle of its 52-week range, there's plenty of room to go up or down depending on what the business reports for the third quarter of its 2014 fiscal year. Keeping this in mind, does the company make for a compelling buy or would an investment in Whole Foods (WFM) or Wal-Mart Stores (WMT -0.08%) make more sense?

Mr. Market has an optimistic view on Costco
For the quarter, analysts expect Costco to report revenue of $25.7 billion. If this forecast is correct, it will represent a 7% gain compared to the $24.1 billion management reported the same quarter a year earlier and would likely be due to an increase in comparable store sales combined with higher store count.

Source: Costco

From an earnings perspective, Mr. Market is still optimistic, but not to the degree that he is with the company's anticipated rise in sales. If estimates prove true, Costco will report earnings per share of $1.09; that's just 5% higher than the $1.04 the company posted for the third quarter of 2013. Rising sales will mostly likely be the cause of this increase in profits, but they could be offset by higher costs and/or an increase in the number of shares outstanding.

How does Costco stack up to its peers?
The past few years have been very kind to Costco and its shareholders. Between 2009 and 2013, the retailer saw revenue climb a whopping 47% from $71.4 billion to $105.2 billion as soaring comparable-store sales and a jump in store count helped the business grow significantly.

During this five-year period, Costco increased its store count by 20% from 527 locations to 634. While this was a major contributor to the company's top line growth, probably the biggest contributor was its rise in comparable store sales, which experienced a 28% aggregate jump.

Over a similar five-year period, Wal-Mart hasn't done nearly as well. Between 2009 and 2013, the world's largest retailer saw sales increase just 17% from $408.1 billion to $476.3 billion as an aggregate rise in comparable store sales of 2% in the U.S. was compensated for by a 35% jump in store count from 8,099 locations to 10,942.

WMT Revenue (Annual) Chart

WMT Revenue (Annual) data by YCharts

While Wal-Mart's performance in recent years has been lackluster because of its huge size and inability to grab significantly more share of an already-mature market, rival Whole Foods has shown that it has what it takes to grow rapidly. Between 2009 and 2013, Whole Foods has managed to grow sales by a jaw-dropping 61% from $8 billion to $12.9 billion.

This jump in revenue for the up-and-coming retailer can be chalked up to two things: strong store count additions and amazing comparable-store sales improvements. Over this five-year timeframe, the company saw comparable store sales soar an aggregate 31%. Meanwhile, the number of locations in operation jumped over 27% from 284 in 2009 to 362 by the end of 2013.

Foolish takeaway
Based on the data provided, it looks pretty clear that investors expect positive but not necessarily stunning growth from Costco this quarter. While this forecast may be a sign that the company's expected growth  is slowing, the fact of the matter is that business has been strong and getting stronger over the past few years. This is especially true when the company is placed next to Wal-Mart but both companies pale in comparison to Whole Foods's performance.

Between 2009 and 2013, Whole Foods grew much quicker than either of its larger peers. With the company's most recent quarterly results, which point to slowing sales and earnings growth, there's no guarantee that the business can continue its strong growth trend . Even if this is the case though, the company, with a P/E of 26, isn't much pricier than Costco's 25 P/E ratio.  So, while management may not be able to grow the business at the speed it once had, its prospects may make a stake in the firm more sensible than its larger, slower-growing rivals.