The amazing decade-plus tech stock bull run came to a screeching halt last November, and tech remains one of the worst-performing sectors of the market this year. The tech-heavy Nasdaq 100 has lost almost 27% of its value so far in 2022, with seemingly no sign of reversing course.

That's made investors leery about making big bets on tech stocks, but savvy investors understand this year's tech wreck just might be the best time to start buying. Sure, you might not catch the precise bottom buying in now, but that doesn't mean your portfolio won't still thank you years down the road when the difference in a few percentage points of gains will look meaningless.

Pocket watch on $100 bills.

Image source: Getty Images.

I wouldn't go out and scoop up every discounted tech stock, but there's a very good argument to be made in favor of a few of them, because they have some massive trends behind them that makes their current weaknesses opportunities.

The pair of top tech stocks below are excellent candidates to buy and hold forever.

Woman sitting amongst computers screens.

image source: Getty Images.

Nvidia

Investors just might have a real bargain on their hands in the form of Nvidia (NVDA -3.33%), which seemed to disappoint the market with its cautious guidance for the current quarter, forecasting revenue of $8.1 billion, below Wall Street's expectation of $8.5 billion. 

Nvidia says the war in Ukraine and China continuing to impose incredibly stringent COVID lockdowns on its people will swipe $500 million of revenue from its results. But with the latter at least promising to ease up on restrictions, this is more of a one-off hiccup for a company that's still on a roll. 

Revenue jumped 46% year-over-year as data center sales continue to expand, growing at a forceful 83% rate and cementing the segment as Nvidia's premier growth market. Even so, the gaming segment, which was long the chipmaker's bread and butter business, also saw impressive 36% growth in the quarter. 

Nvidia also saw strong growth in professional visualization (up 67%), and though automotive and robotics declined 10%, that represents only a tiny portion of total revenue, or about 1.5%.

The high-performance chip maker has its finger on the pulse of all the important arenas for the future of GPUs, and it still enjoyed a 90 basis point gross margin gain despite the challenges of the protracted supply chain issues and global chip shortage.

Down more than 42% in 2022, Nvidia is an easy choice as a long-term buy-and-hold stock.

Gloved hands typing on computer keyboard.

Image source: Getty Images.

Okta

Like death and taxes, the need for cybersecurity firms to protect data from hackers will always be with us, and will undoubtedly grow even greater in the future. It's a crowded space to be sure, and that's creating opportunities for consolidation, but Okta (OKTA -0.65%) looks like one player that has staying power.

Last year was a record for security breaches, according to Identity Theft Resource Center, with the total number of incidents surpassing 2020 by 23% and then rising another 14% in the first quarter over 2021. Cybersecurity firms have reported mixed results, with companies like Check Point Software and Ping Identity missing expectations but Palo Alto Networks and Fortinet beating forecasts. Okta is due to report its results next week, and it has a five-year record of handily outstripping Wall Street's best guesses every single quarter.

Analysts forecast Okta's revenue will quadruple by 2026 to $4 billion, while it will lose money for a few more years before piling on the profits. What makes Okta different from the likes of CrowdStrike, SentinelOne, and ZScaler is its stock is actually priced at a discount across traditional metrics. The security stock goes for just 20 times trailing earnings, 15 times next year's estimates, and only 13 times the free cash flow it produces. The others trade at many multiples above those levels.

Getting a discount on a growth tech stock like Okta today when it has such a runway of expansion ahead of it makes it another good choice to add to your portfolio.