Source: Whole Foods

After the company reported revenue and earnings results for the second quarter of its 2014 fiscal year, shares of Whole Foods (WFM) dropped 19% to close at $38.93. With the retailer's shares trading 41% off their 52-week high, is now a prime time to jump into the stock or should investors consider rivals like Wal-Mart (WMT 1.02%) or Costco (COST 0.84%) instead?

Whole Foods failed to match expectations on both the top and bottom lines!
For the quarter, Whole Foods reported revenue of $3.3 billion. Even though this beat its year-ago figure of $3 billion by 10%, the company's revenue fell short of the $3.4 billion forecast by analysts. The company attributed its jump in sales largely to a 9% increase in its store count, which rose from 349 locations to 379.

Comparable-store sales, which jumped 4.5% compared to the same quarter last year, also made a big contribution to the company's top-line growth. This increase in comparable-store sales stemmed from a 2.1% rise in basket size and a 2.4% improvement in transactions.

Source: Whole Foods

In addition to falling short on revenue, Whole Foods reported earnings per share of $0.38, $0.03 lower than anticipated and in-line with what management saw during the second quarter of 2013. Even though it saw the benefit of higher sales, the company's bottom line remained essentially unchanged because its cost of goods sold inched up from 63.6% of sales to 64.1%.

How does Whole Foods stack up to the competition?
Over the past five years, Whole Foods has been a tremendous growth story for investors. Between 2009 and 2013, the company saw its revenue soar 61% from $8 billion to $12.9 billion. According to the company's most recent annual report, its sales growth resulted from a 31% increase in aggregate comparable-store sales in conjunction with a 27% jump in store count from 284 locations to 362.

WFM Revenue (Annual) Chart

WFM Revenue (Annual) data by YCharts

During the same five-year period, rival Costco also did well for itself, but not to the same extent that Whole Foods did. Because of its larger size, which makes it more challenging to scale the business upward, its revenue has only risen 47% from $71.4 billion to $105.2 billion. The main driver behind Costco's growth has been its comparable-store sales, which rose, in aggregate, 39% from 2009 through 2013. Over this time-frame, the business also enjoyed a nice 20% increase in store count from 527 locations to 634.

The slowest-growing company profiled here has been Wal-Mart. Over the past five fiscal years, the world's largest retailer saw its sales expand 17% from $408.1 billion to $476.3 billion. Unlike Costco and Whole Foods, both of which derived good portions of their growth from comparable-store sales, Wal-Mart saw a modest 2% improvement in comparable-store sales over this period. Instead, management attributed Wal-Mart's rising sales to a 35% increase in store count from 8,099 locations to 10,942.

Foolish takeaway
Based on the data provided, it's understandable why Mr. Market punished Whole Foods after it reported lackluster results, but it's possible that there was some overreaction here. Yes, Whole Foods did fail to meet expectations but the company's long-term results have been phenomenal, especially when placed next to larger rivals like Wal-Mart and Costco.

With a P/E ratio of 26, the company is still pretty pricey in comparison with Wal-Mart's ratio of 16, but its shares are trading at the same level as those of Costco. This suggests that given the business's strong growth over time, it could make for a better prospect than Costco, even in the event that management cannot maintain the stellar growth of the business moving forward.