Warehouse club leader Costco Wholesale (COST -1.78%) broke out of a year-long sales slump in early 2017, and since then, it hasn't looked back. Costco is using its position as the low-price leader to take market share from a variety of competitors, including rival warehouse club Sam's Club.

Costco's sales growth accelerated in May relative to the already-robust growth it had posted over the previous year. This is more good news for long-term investors holding Costco stock.

Sales surge again

Costco Wholesale posted another double-digit sales increase in May. Net sales for the month reached $11.02 billion, up an impressive 14.1% year over year, while comp sales rose 11.7%. This was even stronger growth than the 12.2% sales increase and 9.6% comp sales gain that Costco averaged over the previous eight months.

As has been the case in recent months, a portion of Costco's May comp sales gain was driven by changes in currency exchange rates and gasoline prices. But even adjusting for these two factors, Costco would have posted a stellar 8% comp sales increase last month.

This excellent sales performance came on top of a solid 4.5% adjusted comp sales gain in May 2017, so Costco wasn't facing a particularly easy year-over-year comparison. Furthermore, the bulk of the comp sales growth was driven by a 5.9% increase in comparable-warehouse traffic.

The exterior of a Costco warehouse

Strong customer traffic is driving big comp sales gains for Costco. Image source: Costco Wholesale.

Costco's sales strength was broad-based geographically. Adjusted comp sales rose 8.7% in the U.S., 5.4% in Canada, and 7.4% for the rest of the world. Cannibalization from new warehouses was a major cause of Canada's modest underperformance (not that 5.4% comp sales growth is anything to sneeze at).

Winning along with Best Buy

Costco achieved solid sales growth in many merchandise categories, but management continued to highlight "majors" as a particularly high-performing area. Comp sales skyrocketed by more than 20%, led by computers, tablets, and appliances.

Those three product categories are right in Best Buy's (BBY -2.19%) wheelhouse. However, Costco doesn't seem to be gaining market share at Best Buy's expense. Last quarter, Best Buy reported that domestic comp sales jumped 10.2% in the computing and mobile phones category and 13% for appliances. (Meanwhile, international appliance comp sales surged a staggering 37.7% year over year.)

Indeed, Best Buy and Costco Wholesale both seem to be benefiting from the downsizing and disappearance of major competitors in these categories. Most notably, regional appliance and consumer electronics retailer hhgregg liquidated about a year ago, and Sears Holdings has closed an enormous number of stores. There could be more upside ahead for Best Buy and Costco in appliances and consumer electronics as Sears spirals toward bankruptcy.

The stock looks pricey. So what?

Costco stock rallied following the May sales report, surpassing $200 for the first time. This puts the stock's valuation at a lofty 29 times current-year earnings.

However, this high valuation seems entirely justified by Costco's growing sales momentum. The rising sales productivity of Costco's warehouses and the company's increasing purchasing scale are further widening Costco's cost advantage over its competitors. This should enable the company to sustain a strong growth rate for many years to come. In a world where consistent growth is hard to come by, Costco stock is worth every penny.