All the attention on Wall Street seems to be going to the tech sector these days, mainly due to the ongoing artificial intelligence (AI) boom. This can be justified, given that some of the world's most valuable enterprises have connections to the space. In fact, several of them are worth more than $1 trillion apiece.

Still, it's refreshing to know that there are some businesses that have nothing to do with AI that are performing well right now. Costco (COST -0.07%) is one such company. This retail stock has been a big winner for investors in the past few years. But could the warehouse retail giant get to a trillion-dollar market cap by 2030?

Costco is a fantastic business

Costco is arguably one of the best businesses in the world. That might sound like a bold statement, but there are reasons to adopt this perspective. For example, it has consistently grown revenue and earnings over multiple decades, and continues doing so.

What stands out to me when looking at Costco is how the business is currently faring. Despite higher interest rates and lingering inflationary pressures -- headwinds that are derailing many retailers' results -- this company continues to post strong numbers. In its fiscal Q3 2024, which ended May 12, same-store sales were up 6.6% and diluted earnings per share soared by 29%.

Another reason this is a quality enterprise is because of the presence of an economic moat. Costco benefits from tremendous advantages of scale. Because it has such a massive revenue base, it's able to obtain more favorable pricing from suppliers than its smaller rivals.

What would a company be without its customers? Focusing on this key stakeholder group is paramount to achieving lasting success, and there aren't many businesses that do so quite like Costco. Selling high-quality merchandise from top brands at low prices in a no-frills shopping environment is a recipe for keeping its customers happy.

Of course, this loyalty is supported by the company's membership system. The worldwide renewal rate was 90.5% in the most recent quarter, indicating that Costco continues to satisfy its shoppers. Plus, those memberships generate a predictable recurring revenue stream.

Do the math

As of June 25, Costco's market cap sat at $379 billion. It has expanded by an impressive 644% in the past decade. This makes the business the 26th most valuable in the world.

Currently, seven companies are worth more than $1 trillion right now. For Costco to join this exclusive club in 2030, its market cap would need to rise by 164% over the next six years. This amounts to an annualized growth pace of 17.6%.

Based on the stock's historical performance, investors might think that it's a foregone conclusion that Costco will be a trillion-dollar company by the end of the decade.

Gauging the market's expectations

It's easy to extrapolate past results over the next several years as if prior patterns will simply persist. However, it's important to understand the current situation as one considers what Costco shares are likely to do next.

To be clear, the market appears to have become extremely optimistic about this business. The stock trades at a price-to-earnings ratio of 53 -- truly a nosebleed valuation. Shares have not been this expensive since 1999.

With that in mind, I don't expect Costco will reach a $1 trillion market cap by 2030. And I'm not sure when, or if, it will happen.

In fact, it wouldn't shock me one bit if Costco shares underperformed the broader S&P 500 or Nasdaq Composite indexes over the next decade. Investors should think twice if they're looking to buy the stock at its current valuation.