The stock market hasn't been a happy hunting ground for investors in 2022, but investors willing to look past the volatility could make a fortune if they buy and hold solid companies for a long time.

That's evident from the impressive returns that some top stocks have generated over the last decade. Advanced Micro Devices (AMD 1.96%), Palo Alto Networks (PANW -1.48%), and Amazon (AMZN -1.64%) are three high-flying companies that have made investors significantly richer over the years.

AMD Chart

AMD data by YCharts

More importantly, these technology companies have terrific growth prospects that should help them replicate their outstanding gains over the next decade. Let's look at the reasons why investors looking to retire as millionaires after a decade should consider investing $50,000 in these three names.

1. Advanced Micro Devices

A $50,000 investment in shares of AMD at the beginning of 2012 was worth more than $1.3 million at the end of 2021. Of course, the stock has pulled back 42% so far in 2022, but investors who bought the company's shares a decade ago are still sitting on fat gains.

The good part is that AMD's slide this year has made the stock attractive as far as its valuation is concerned. The stock's price-to-earnings (P/E) ratio of 31 is way lower than its five-year average earnings multiple of 105. The forward P/E of 20 points toward healthy growth in AMD's bottom line over the next year.

More importantly, a closer look at the markets that AMD serves tells us that this company could grow at an impressive pace for years to come. Take the data center business, for example, which currently produces around 20% of AMD's total revenue. The chipmaker has been enjoying terrific traction in this market, as AMD's data center revenue doubled year over year in the first quarter of 2022.

It wouldn't be surprising to see the data center business move the needle in a bigger way for AMD. That's because the company sells data center CPUs (central processing units), GPUs (graphics processing units), data processing units (DPUs), and field-programmable gate arrays (FPGAs). The data center business has so far been driven by the CPU and GPU business, but AMD has strengthened its prospects in this space with the acquisitions of Xilinx and Pensando.

As a result, AMD now has a complete portfolio of chips to target the fast-growing market for data center accelerators, which is expected to clock an annual growth rate of 32.5% through 2031 as per a third-party estimate. Throw in AMD's solid prospects in the video gaming space, where demand for chips that power gaming PCs and consoles is set to expand, and it is easy to see why analysts are expecting its earnings to grow at almost 33% a year for the next five years -- a growth rate that it could sustain for a longer period thanks to the catalysts mentioned above.

2. Palo Alto Networks

Palo Alto Networks is another stock that has turned out to be a terrific investment. A $50,000 investment in Palo Alto in July 2012 when it made its stock market debut was worth more than $508,000 at the end of 2021.

The secular growth of the cybersecurity market and Palo Alto's growing dominance should help the company replicate those terrific gains over the next decade. According to a third-party report, the global cybersecurity market could generate $500 billion in revenue by 2030, clocking an annual growth rate of 12% through the end of the decade.

Palo Alto Networks is in a solid position to tap into this incremental revenue opportunity considering that it is outpacing the industry's growth. The cybersecurity specialist is on track to finish fiscal 2022 with revenue growth of 29% to approximately $5.5 billion. More importantly, Palo Alto's remaining performance obligations -- a metric that represents the total value of customer contracts for which the company has yet to provide services and recognize revenue -- indicate that its offerings are in solid demand.

Palo Alto's remaining performance obligations for the fiscal third quarter (which ended on April 30), increased 40% year over year to $6.9 billion. The faster growth in this metric compared to its actual revenue, as well as the fact that it easily exceeds the company's trailing-12-month revenue of $5.17 billion, suggests that Palo Alto's fast growth is here to stay.

It is worth noting that Palo Alto's acquisition-centric growth strategy has worked wonders so far, allowing it to corner a bigger share of the cybersecurity market. Analysts are forecasting 27% annual earnings growth from Palo Alto for the next five years, though it wouldn't be surprising to see it sustain that growth for the next decade thanks to the factors discussed above.

3. Amazon

Amazon stock has given up a third of its value in 2022, but investors shouldn't forget that the e-commerce and cloud computing giant has been a stellar investment over the years. A $50,000 investment in Amazon stock at the beginning of 2012 was worth over $960,000 at the end of 2021.

The stock's sharp pullback this year gives investors the opportunity to buy this tech giant at a relatively cheap valuation. Amazon stock currently has a P/E ratio of 52, which points toward a big discount as compared to its five-year average of 122. The sales multiple of 2.34 also represents a discount to its five-year average multiple of 3.9.

Investors should consider using Amazon's relatively attractive valuation to buy the stock and set their portfolios up for potentially solid gains over the next decade. That's because the company is a key player in two lucrative markets.

For one, Amazon controlled 56.7% of the e-commerce market in the U.S. in 2021. That's double Amazon's share of 28.1% in 2014. So the company still has room to grow its e-commerce business in the lucrative U.S. market, where the online channel accounts for just 23% of overall retail sales. Morgan Stanley estimates that the e-commerce channel could account for 31% of overall retail sales in the U.S. by 2026.

The e-commerce market in the U.S. reportedly generated $767 billion in revenue last year. It is expected to generate $1.33 trillion in sales by 2025, and it could record solid growth beyond that as well as e-commerce penetration increases. As a result, Amazon's e-commerce business seems built for secular growth in the U.S.

The cloud computing market is another reason to be positive about Amazon's future. The Amazon Web Services (AWS) business controls a third of the global cloud services market, which was worth an estimated $180 billion in 2021. The cloud computing market is expected to grow at an annual pace of 17% through 2030.

It is worth noting that AWS has consistently held on to its healthy cloud computing market share over the past five years despite the competition in this niche. As a result, the massive cloud computing opportunity has the potential to supercharge Amazon's long-term growth along with the e-commerce opportunity. This explains why analysts are anticipating 40% annual earnings growth from Amazon over the next five years, though its catalysts could help sustain the growth through the end of the decade.