The current tech-fueled bull market has driven the Nasdaq Composite up 30% over the last 12 months. That rate is well above the index's average annual growth rate over the last 30 years of about 11% (excluding dividends). So it isn't wise to expect it to continue at such a torrid pace. It also isn't wise to compare individual stocks based on the current pace.

Investors looking to outperform the Nasdaq over the long term should look for companies that can grow their earnings per share faster than the index's historical rate of return. The index can rise or fall sharply each year, but stocks ultimately follow business fundamentals over many years.

Here are two stocks with above-average prospects of smashing the Nasdaq Composite's historical rate of return over the next five years.

1. Nvidia

The leading cloud service providers spent $260 billion on data center infrastructure in 2023, according to the Dell'Oro Group (a telecom and networks analyst firm). The outsized demand for artificial intelligence (AI) will drive that spending even higher. Nvidia (NVDA -1.52%) is one of the best stocks to own to take advantage of this opportunity thanks to its leading position as the hardware supplier of choice for the world's top cloud companies.

Dell'Oro expects data center spending to grow 18% annually as more investment shifts to AI, and there's currently no competitive substitute for the power of Nvidia's graphics processing units (GPUs). Nvidia controls over 70% of the market for AI chips, so the projection for the data center market growth is effectively an estimate of Nvidia's growth. The company will face increasing competition from other companies working to design their own AI-specific chips. But it might not be all that easy to win market share, since Nvidia has been the leader in GPUs for many years and generates very high margins to reinvest in the business.

Nvidia is taking action to protect its lead, releasing more new products at a faster rate. Its new Blackwell GPUs (expected to go on sale later this year) will deliver processing that's up to four times faster for AI training compared to its previous Hopper generation. Management reported that Blackwell demand is already outstripping supply, which should translate to healthy profits this year. And Nvidia is already talking about Blackwell's replacement, Rubin, which will be available in late 2025.

Nvidia's earnings surged 629% year over year last quarter. Demand for its advanced GPUs is a catalyst for more robust earnings growth and returns to shareholders. Wall Street analysts project earnings to grow at an annualized rate of 31%, which should be more than enough to outpace the average company in the Nasdaq Composite index.

2. Datadog

The cloud computing industry continues to demonstrate the growth that can earn investors handsome gains over the long term. Cloud infrastructure spending grew 21% year over year in the first quarter, according to Synergy Research Group.

Large companies use Datadog's (DDOG 4.08%) DevOps platform to monitor cloud security and application performance running on the cloud. This means Datadog is exposed to the broader growth in the cloud market, setting up the potential for market-beating shareholder returns.

Datadog's revenue grew 27% year over year in the first quarter -- outpacing the increase in spending across the broader cloud market, which is a good sign. Its growth has slowed over the last few years, but it reflects a relatively soft market, as companies have held back spending to lower costs and optimize their cloud usage. Nonetheless, Datadog's superior growth indicates that it has a competitive offering.

Cloud monitoring is a competitive market, but customers clearly favor Datadog's products. The company's churn levels continue to be low as customers are adopting more of the products available on its platform.

One reason customers like Datadog is the array of new products it continues to introduce. It launched 12 of them from 2020 to 2022, and these products now contribute about 11% of its annual recurring revenue. Management continues to roll out new features for customers, including the recently available Bits AI -- a conversational assistant that enables customers to efficiently resolve problems.

The stock is up 216% since 2019, more than doubling the return of the Nasdaq index. With the company also starting to convert growing revenue into profits, it's a good candidate to outperform. Even in a relatively soft cloud market, analysts are still projecting Datadog's earnings to grow 17% annually over the long term.