Palo Alto Networks (PANW 0.91%) and DocuSign (DOCU -0.26%) were both popular tech stocks during the buying frenzy in growth plays in 2021. But as that euphoria faded and inflation, rising interest rates, geopolitical conflicts, and other macro headwinds rattled the markets, the two stocks headed in opposite directions.

Palo Alto's stock continued rising and hit an all-time high on Dec. 13, 2023. It remains just 10% shy of that level as of this writing. DocuSign's stock closed at its record high on Sept. 3, 2021, but it subsequently lost more than 80% of its value.

A person checks a smartphone while holding a cardboard cutout of a cloud.

Image source: Getty Images.

Palo Alto continued to impress investors with the robust growth of its cybersecurity services, but DocuSign disappointed them as the growth of its e-signature services platform slowed down in a post-pandemic market. Palo Alto was also better insulated from the macro headwinds than DocuSign, since most companies wouldn't lower their digital defenses just to save a few dollars. DocuSign's business was less resilient, since companies used its services less frequently during economic downturns. Palo Alto has clearly been the better overall investment, but will it continue to outperform DocuSign in 2024?

Why did Palo Alto impress the bulls?

Palo Alto serves more than 80,000 enterprise customers, which makes it one of the world's largest cybersecurity companies. It provides its services through three main ecosystems: Strata, which hosts its older on-site network security services; Prisma, which handles its cloud-based security services; and Cortex, its artificial intelligence (AI) threat detection platform. It generates most of its growth from Prisma and Cortex, which it collectively calls its next-gen security (NGS) services. As of its latest quarter, it generated 44% of its trailing-12-month revenue from its NGS services.

Palo Alto's revenue rose 25% in fiscal 2023, which ended last July, even as the macro headwinds forced many companies to rein in their software spending. For fiscal 2024, it expects its revenue to rise 18%-19%. It attributes that slowdown to the macro headwinds, which are making it tougher to lock new customers into longer contracts.

But on the bright side, Palo Alto is still signing a lot of new customers to "deferred billings" contracts that will be paid off at a later date. That strategy ensures that its growth will accelerate again once the macro environment improves.

In the meantime, Palo Alto continues to rein in its spending and stock-based compensation expenses to strengthen its margins. As a result, it's remained firmly profitable on the basis of generally accepted accounting principles (GAAP) over the past six consecutive quarters -- and it expects its non-GAAP earnings per share (EPS) to rise 22%-25% in fiscal 2024.

Palo Alto's stock isn't cheap at 53 times forward earnings, but its robust growth and ability to keep growing in a tough market arguably justify that higher valuation.

Why did DocuSign attract the bears?

DocuSign controls about 70% of the e-signature services market. Its business thrived during the pandemic as more companies digitized their contracts for their workers and customers, but it failed to maintain that momentum as the pandemic ended, the economy cooled, and aggressive competitors such as Adobe Sign and Dropbox Sign crept into its backyard.

DocuSign's revenue rose just 19% in fiscal 2023, which ended last January, compared with its 45% growth in fiscal 2022 and 49% growth in fiscal 2021. It expects that slowdown to worsen with just 9% revenue growth in fiscal 2024.

DocuSign might be running out of steam in this tough environment, but CEO Allan Thygesen, who took the helm in October 2022, plans to reaccelerate its growth with new AI-powered services, digital contract tools, and deeper integrations with popular enterprise collaboration platforms such as Microsoft Teams, Zoom Video Communications, and Salesforce's Slack. That expansion could widen its moat, lock in more customers, and turn it into a more diversified software company -- but it could take years to bear fruit.

As DocuSign's growth cools off, it's focused on stabilizing its profit with aggressive cost-cutting measures. It turned profitable on a GAAP basis over the past four consecutive quarters, and analysts expect its non-GAAP EPS to rise 41% in fiscal 2024.

That progress is encouraging, and DocuSign's stock certainly looks cheap at 19 times forward earnings. However, that lower valuation reflects a lot of uncertainties regarding its future growth and its ability to stay ahead of the competition.

The better buy: Palo Alto Networks

It's easy to see why Palo Alto Networks outperformed DocuSign over the past two years. It's growing faster, it's better diversified, and its business model is better insulated from the macro challenges. Its stock might seem pricier, but I believe it deserves that premium valuation and will continue to outperform DocuSign for the foreseeable future.