Many of us are in the market for some strong performers for our long-term portfolios. For best results, we should be seeking high-quality companies -- those with, for example, rising revenue and profits, robust profit margins, strong cash flow, little debt, and sustainable competitive advantages.

That's not enough, though -- we should also demand attractive prices, as buying into a stock at too high a price can limit how much you gain from it. Here are three terrific businesses that you might want to keep an eye on.

1. Costco

Costco (COST -0.82%) is clearly a high-quality company, with a winning formula. It serves employees well by offering attractive pay and benefits, and this keeps its turnover relatively low. It serves customers by limiting its markups on products to no more than 14% or 15%, and it serves shareholders by growing its business well while paying a dividend. That payout recently yielded only 0.75%, but it has increased its dividend by an annual average of 12% over the past five years and further increases can be expected.

The retailer recently had 849 stores, two-thirds of which are in the U.S. and Puerto Rico. It has been expanding internationally -- recently into China, for example -- and continued global expansion should be a good growth driver for the company.

Costco's shares were recently down more than 20% from their 52-week high, but that doesn't put them in bargain territory. Instead, with price-to-sales and price-to-earnings (P/E) ratios recently near their five-year averages, it seems reasonably priced. Thus, if a market downturn were to send the shares south, they may end up presenting a great opportunity.

2. WM

WM (WM -0.10%), formerly known as Waste Management, is in an industry that can be expected to grow indefinitely -- the collection, disposal, recycling, and in some cases, transformation, of trash. Check out how the company describes itself:

WM has the largest disposal network and collection fleet in North America, is the largest recycler of post-consumer materials and is the leader in beneficial reuse of landfill gas, with a growing network of renewable natural gas plants and the most gas-to-electricity plants in North America. WM's fleet includes nearly 11,000 natural gas trucks -- the largest heavy-duty natural gas truck fleet of its kind in North America -- where more than half are fueled by renewable natural gas.

The company has been a great long-term performer, with its stock averaging annual gains of more than 16% over the past decade. (The S&P 500, in contrast, averaged less than 11%.) That might make you want to buy shares now, but hold on. Waste Management's shares were recently down 12% from their 52-week highs, but they're still not in bargain territory. Like Costco, its price-to-sales and price-to-earnings (P/E) ratios were recently near their five-year averages, leaving the stock seeming roughly fairly priced. So while you might do all right buying now and hanging on for a few decades, you'd probably do better if you wait for a pullback in price. Note, too, that WM pays a dividend -- that recently yielded 1.9%.

3. Mastercard

Shares of Mastercard (MA -0.54%) have not dropped as much as Costco's or Waste Management's over the past 52 weeks, and it's not a screaming buy, either. But it's well worth adding to your watch list, in the hope of a drop in share price, as it can be a strong performer in your long-term portfolio. Over the past decade, its shares have averaged annual gains of 21%.

The company's fourth quarter featured revenue up 17% on a currency-neutral basis, with net income up 16% and management forecasting revenue growth in double digits for 2023. Over the full year, revenue jumped 23% on a currency-neutral basis, with net income growing by 21%.

There's a lot to like about Mastercard. For one thing, it makes its money through the payment platform it offers and doesn't take on credit risk. In other words, if you have a Mastercard in your pocket, the bank that issued it is at risk if you don't pay your bills -- not Mastercard.

The stock pays a dividend, too. The yield was recently just 0.64%, but it has been growing for a long time, averaging annual increases of 18% over the past five years.

These are just a few of the many attractive companies out there that could serve your long-term portfolio very well. For best results in investing, you want to buy into such companies when they're undervalued. Or, if you're impatient, perhaps buy into them incrementally, hoping for lower prices at some point in the future.