Times of market turmoil are often, in retrospect, the very best times to buy high-quality stocks for the long haul.

In uncertain times, many investors in or near retirement may panic over short-term concerns, selling their stocks at the first whiff of a potential economic downturn. But that gives more patient investors a window to pick up shares of top companies highly likely to achieve long-term gains.

After the tech sector fell far more than the markets in 2022, and pulled back just this February, the following three all-star tech names seem ripe for the picking.

Amazon

Amazon (AMZN -1.65%) shares remain near the levels they reached four years ago -- 50% below their all-time highs. This is despite the e-commerce and cloud giant having more than doubled its revenue over that time.

With rising interest rates, investors have shunned "unprofitable" tech stocks in favor of near-term profits and cash flows. That is probably understandable for most tech companies less mature and diversified than Amazon, but Amazon is a unique beast.

Since its founding as an online bookseller, Amazon has plowed all excess underlying profit back into new businesses, forgoing current profits. Just take a look at this long-term chart:

AMZN Revenue (TTM) Chart

AMZN Revenue (TTM) data by YCharts.

While Amazon's revenue has grown from virtually nothing to over $500 billion, its operating earnings have vacillated around breakeven for much of its corporate history. If Amazon were "structurally unprofitable" as skeptics claim, it would be pretty hard to come out close to breakeven year in and year out for nearly 30 years, right?

That means the target of breakeven is likely intentional, and that Amazon is structurally profitable. And with the company spending all it makes, management may see new potential areas of growth. Today, those are likely to include healthcare, satellite broadband, and self-driving cars.

While a less-proven management team's spending should be met with skepticism, Amazon's track record of innovation -- from inventing the concept of cloud computing, to third-party e-commerce marketplaces, Prime subscriptions, and much more -- should assure shareholders that CEO Andy Jassy and his team know what they're doing.

In 2022 revenue growth slowed down, but that was coming off the near-impossible comparable sales of the pandemic. Actually, the fact that North American retail sales kept up 13% growth in 2022 is pretty incredible. While international sales declined 8%, that was entirely due to changes in currency rates. Without that factor, international retail would have been up 4% last year.

While Amazon Web Services is showing a deceleration these days, this may not be a surprise; customers are now taking time to optimize their cloud spending after years of rapid adoption, especially with economic uncertainty in the air.

Still, the cloud computing opportunity remains large, and Amazon may be doing better than its headline numbers suggest. While AWS revenue grew just 29% in 2022, down from 37% in 2021, its remaining performance obligations (RPO), or long-term contracts signed with customers, rose from $80.4 billion at year-end 2021 to $110.4 billion at year-end 2022 -- growth of 37.3%.

The difference between contracted bookings and revenue is dependent on near-term cloud usage, and customers are now in cost-saving mode. However, once the cost-optimization process ends and the economy improves, AWS' growth rate could very well pick up again toward its RPO growth rate.

In short, Amazon's difficult year isn't quite as bad as headline numbers would suggest, and its growth opportunity looks intact, making the stock look like a bargain at just 1.8 times sales.

Businessperson standing on a city street holding a newspaper.

Long-term thinking can lead to outsized investing gains. Image source: Getty Images.

Lam Research

Parts of the semiconductor sector are in a severe downturn. But in chip world, when everything seems to be falling apart, it's often the best time to buy. And in this arena, investors should look closely at semiconductor equipment stocks -- companies that sell machines that help make the semiconductors. That's because these companies tend to operate in an oligopoly with solid margins, and don't require lots of capital spending as foundries do. Equipment stocks also have recurring services revenue and profits tied to their installed base.

Lam Research (LRCX 1.87%) is one of only three large companies that dominate etching and deposition across the chip production landscape, with a history of innovating at the leading edge.

Shares currently trade at just 13 times earnings, due to the likelihood that earnings will fall this year as memory customers pull back on spending. Lam, which makes equipment crucial for the vertical stacking of NAND flash modules, has about half of its sales coming from the memory sector -- a higher proportion than the overall industry.

However, there will come a day when memory demand bounces back, especially as new applications such as artificial intelligence require huge amounts of memory and storage.

Meanwhile, Lam continues to gain market share at leading-edge foundry and logic customers. On the recent conference call with analysts, CEO Tim Archer noted that Lam recently doubled its market share at a leading foundry and logic customer, and also inked customer wins for gate-all-around transistors, the new type of transistor in upcoming 3 nanometer and 2 nanometer nodes. These leading nodes also generally require 25% to 30% more etching equipment intensity, which is where Lam excels.

Moreover, at a recent conference, CFO Doug Bettinger noted that etching tools are especially good for Lam's services and replacements business, as etch machines tend to need replacement parts and maintenance more often than other types of semiconductor equipment. Perhaps that's why Lam has the highest percentage of support services revenue (compared to total revenue) in its niche, at roughly 33% of sales last quarter.

Recurring services should stabilize results during downturns, and allow the company to continue paying a growing dividend, while making a healthy number of share repurchases.

Super Micro Computer

Unlike the two stocks above, Super Micro Computer (SMCI 4.33%), a maker of servers, actually doubled in 2022; it now sits near all-time highs. Yet it only trades at 9 times earnings, and the company should continue to benefit from the growth of artificial intelligence (AI).

Supermicro is in a typically low-margin business: server assembly. However, the company has been able to differentiate its offerings in some important ways. First, it has long focused on heat-efficient designs and liquid cooling systems, which greatly enhance the efficiency of data centers that don't need to be cooled as much. Leading-edge AI graphics processing units (GPUs) and central processing units (CPUs) pack lots of transistors into a small space, but that creates more and more heat problems with each node. Being able to dissipate heat is a huge advantage.

In addition, CFO David Weigand noted at a recent conference that Supermicro doesn't have any "standard" server models, but rather mass-customizes to customer specifications. And due to its base in Silicon Valley, Supermicro has a close relationship with leading chipmakers, often enabling it to be first to market with servers that incorporate the latest chips.

Energy efficiency, customizability, and short time to market (TTM) have caused Supermicro's sales to take off, growing 53.8% last quarter, with earnings skyrocketing 320%.

What can keep the momentum going? Well, founder Charles Liang is still running the company after 30 years, and owns a significant 13.9% of shares outstanding. In March 2021, the board changed Liang's compensation so that he earns just $1 in salary; the rest of his compensation consists of performance awards based both on revenue growth and on Supermicro's stock price, with various targets going up to $120 per share.

A highly incentivized founder-CEO is often a recipe for market-trouncing returns, making Super Micro Computer a buy even after its strong run.