Our world is growing more and more digital. The technology around us is evolving, turning entire industries upside down. Good tech stocks can deliver market-beating investment returns in the long run.

However, technical problems are often hard to understand, tech companies rarely turn a profit in the early days of accelerated revenue growth, and competition is always a threat. Consider these two tech stocks the next time you're adding companies to your portfolio, as they should benefit from secular market trends.

1. AMD

Semiconductor stocks are poised for a healthy rebound over the next couple of years. The lack of manufacturing capacity in China and Taiwan is under correction, as chip-building specialists are expanding their facilities in places like Arizona, upstate New York, and central Ohio. The chip shortage should be a fading memory in a year or two, and that crucial development could be the final straw that breaks the inflationary camel's back.

And some chip designers are better positioned than others to make the most of that upcoming market recovery. Advanced Micro Devices (AMD 1.78%) belongs to this group, and you should take a hard look at this company if you are interested in the semiconductor sector's upcoming rebound.

AMD is producing impressive results even during the aforementioned manufacturing shortage. Revenue rose 70% year over year in the recently reported second quarter. Adjusted net income more than doubled in the same span. Earnings per share lagged behind the pure bottom-line result due to the expanded share count after the stock-swap buyout of Xilinx. Even so, many hardware companies would sell their proverbial mothers to achieve a 67% jump in earnings per share.

So AMD's business is already healthy, and the company still looks forward to even stronger results in the years to come. The Xilinx deal made AMD an instant giant in a whole new set of markets, including industrial computing and Internet of Things devices.

The company faces slower sales growth and tighter profit margins, partly due to the market-widening Xilinx deal and partly because of weaker consumer demand in the inflation-driven economic crisis. However, the stock is trading at its lowest price-to-earnings ratio in recent memory, and the long-term view looks encouraging.

This semiconductor stock may not be a slam-dunk buy today, but the AMD shares you buy at the current price should make you money in the long run. Just be prepared for some speed bumps on the long road to wealth-building riches.

AMD Normalized PE Ratio Chart

AMD Normalized PE Ratio data by YCharts

2. The Trade Desk

Advertising is a powerful marketing tool. Targeted ads are even stronger, adding value to each ad spot and boosting the advertiser's chance of landing a sale. And when you can automate the ad targeting, based on up-to-the-minute user data from a massive network of business partners, you've reached a whole new level of effective advertising.

That's what The Trade Desk (TTD -0.27%) does. As a leading provider of marketing campaign services for buyers of digital ad space, this company helps other businesses meet their sales goals.

The digital advertising sector is in shambles right now. Advertisers around the globe have slowed down their ad spending in response to rampant inflation in the U.S. and many other countries. But The Trade Desk keeps delivering solid results even in this sectorwide downturn.

Second-quarter revenue rose 35% year over year while adjusted earnings increased by 13%. During this quarter, important partners including Walt Disney and Amazon committed to supporting The Trade Desk's Unified ID 2.0 solution, which gives the company a stable traffic analytics platform in uncertain times.

Like AMD, The Trade Desk is not only poised to generate healthy results in the future but is already doing so today. Yet, market makers have dragged The Trade Desk's shares down in this year's general flight from seemingly risky growth stocks. As a result, the stock price is down 39% in 2022.

The Trade Desk's shares aren't cheap by any measure, but you get what you pay for. The Trade Desk is a leader in an important market that should stay relevant for decades to come. So you're paying a premium price for a top-quality business here, and that's how the most successful investors make their money.

Don't be afraid to follow that profitable strategy. The Trade Desk is a strong buy today, even if its valuation ratios look lofty.