There's no getting around the fact that technology stocks suffered in 2022. Some investors are looking for safer places to invest their money to help manage high inflation and the uncertainty in the market. 

But the tech sector has historically been a fantastic place for investors, and permanently ignoring long-term tech trends could come at the cost of missing out on some fantastic investment opportunities. 

That's why -- even amid a tech sell-off -- investors should consider CrowdStrike Holdings (CRWD -9.69%) and Advanced Micro Devices (AMD -0.84%) as they tap into the expanding cybersecurity and semiconductor markets. Here's why these two tech stocks are worth buying and holding for the next decade. 

A person pointing to a computer.

Image source: Getty Images.

1. CrowdStrike is still growing, and much cheaper than before 

CrowdStrike is a cloud-based cybersecurity company that helps customers protect everything from desktops to mobile devices from threats, and it's a very big business. The global cloud security market will be worth an estimated $77.5 billion by 2026, and CrowStrike is already doing a fantastic job of benefiting from this space. 

In the company's second quarter of fiscal 2023 (reported on Aug. 30) CrowdStrike's total sales climbed 58% to $535.2 million, and its free cash flow soared 84% to $136 million. The company subscription customers jumped 51% from the year-ago quarter to 19,686, marking six straight quarters of 50% or more growth. 

Even with its strong second-quarter results that beat analysts' consensus estimates, CrowdStrike's stock price has suffered along with the broader market's decline. But the drop has left CrowdStrike's stock much cheaper than before.

The cybersecurity company now trades at just 16 times the company's forward price-to-sales, down significantly from a price-to-sales of 55 one year ago.

With the stock's cheaper price tag and the company's ability to continue to grow despite difficult times, this cybersecurity stock looks like a smart buy for long-term investors looking to tap into the massive cybersecurity market.

2. AMD has diverse revenue streams and is trading at a discount

AMD is a leading semiconductor company that benefits from both central processing unit (CPU) market and the graphics processor unit (GPU) market, with the latter offering lots of potential upside.

The company's stock fell along with many other tech stocks over the past year, and the company's third-quarter results didn't help matters much. Sales in the company's Client segment fell 40% year over year to $1 billion because of slowing PC demand.  

But the company's quarter wasn't all bad news. Thanks to AMD's diverse revenue segments, it benefited from its data center revenue climbing a very impressive 45% year over year to $1.6 billion, and the company's gaming sales increased 14% to $1.6 billion.  

Those diverse revenue streams in fast-growing markets give investors a long-term opportunity with AMD. Semiconductor sales for the data center market will grow from a $9.5 billion market last year into an estimated $14.1 billion market by 2027.  

Even more impressive, the entire GPU market will increase to an estimated $130 billion in 2027, up from just $24 billion last year. 

With AMD's stock beaten down over the past year but the company still experiencing growth from some of its core revenue segments, the stock looks like a smart buy for investors right now. Consider that AMD's shares now trade at a forward price-to-earnings of just 15, which is much lower than its price-to-earnings of 34 one year ago. 

That makes this leading semiconductor relatively cheap compared to last year, and with the company's opportunities in the broad GPU space, AMD will likely continue benefiting for years to come.

Keep this in mind

Long-term investors know that taking a buy-and-hold approach is easy when the market is all sunshine and rainbows. It's when the market is in turmoil that this proven investing strategy is really tested. 

That may mean that investing in these stocks in the near term could bring some more volatility, but over the long term adding great companies to your portfolio and holding them for five years or more is a great way to grow your portfolio.