Palantir (PLTR -0.33%) and Datadog (DDOG 0.34%) both streamline the collection of data for organizations. Palantir's government-oriented Gotham platform and commercial-oriented Foundry platform accumulate data from a broad range of disparate sources. Datadog's platform collects real-time diagnostics data from an organization's servers, databases, and apps, then aggregates that information onto unified dashboards to aid IT professionals.

Palantir and Datadog operate in different markets, but they attracted a lot of bullish attention after their public debuts.

Palantir listed its stock through a direct listing in September 2020, and its shares opened at $10 before skyrocketing to an all-time high of $39 the following January. Datadog went public through a traditional IPO at $27, and it surged more than seven-fold to its record high of $196.56 during the feverish peak of the growth stock rally in November 2021.

Two IT professionals work at a computer.

Image source: Getty Images.

But now, Palantir trades at about $15, while Datadog shares trade  just under $100. The bulls retreated from both stocks as their revenue growth cooled in a more challenging macroeconomic environment. Rising rates also popped their bubbly valuations.

Do these drawdowns represent promising buying opportunities for long-term investors?

Which company is growing faster?

Palantir's revenue rose 47% in 2020 and 41% in 2021, and the company initially claimed it could grow its top line by at least 30% annually through 2025. However, its revenue only rose 24% in 2022, and it expects just 14% to 17% growth in 2023.

That slowdown was mainly caused by its commercial business, which was exposed to more macro headwinds than its government business. Palantir also faced stiff competition from similar platforms like Alteryx in the commercial market.

On the bright side, Palantir's year-over-year growth in commercial revenue finally accelerated again in the first quarter -- which ended its three-quarter streak of decelerating growth -- as its U.S. business gradually recovered and offset softer overseas growth.

Palantir also expects the rise of generative AI platforms like ChatGPT to fuel its long-term growth by driving more government organizations and large companies to crunch massive amounts of data.

Datadog's revenue rose 66% in 2020, 70% in 2021, and 63% in 2022. That rapid expansion was driven by its organic growth in customers, high dollar-based net retention rate of more than 130%, and its acquisitions of smaller companies.

But for 2023, Datadog expects its revenue to rise 24% to 25% as its net retention rate slips below 130%.

Like Palantir, Datadog's growth cooled as macro headwinds forced organizations to rein in their spending on sweeping software upgrades. Datadog also faces plenty of competition from similar platforms like New Relic and Cisco's AppDynamics.

But just like Palantir, Datadog expects to profit from the secular expansion of the generative AI market. It believes the AI boom will strengthen its tools as well as fuel the development of more AI-created and AI-powered apps, which in turn could bolster the market's demand for its observability and diagnostic services.

Which company is more profitable?

On an annual basis, Palantir and Datadog are only profitable by non-GAAP (generally accepted accounting principles) measures, which exclude their stock-based compensation (SBC) expenses.

However, Palantir squeezed out GAAP profits over the past two quarters by cutting costs and reining in its stock-based compensation expenses, and the company expects to stay profitable on a quarterly basis through the rest of 2023.

Analysts expect Palantir to generate a GAAP net profit of $115 million in 2023, compared to its net loss of $374 million in 2022, and to more than triple its non-GAAP EPS. Based on those expectations, Palantir trades at 69 times its forward non-GAAP earnings.

Meanwhile, Datadog is still deeply unprofitable on a GAAP basis, and it actually plans to ramp up spending to expand its workforce as its revenue growth declines. The bulls might interpret that strategy as a show of strength, but analysts expect it to more than double its GAAP net loss from $50 million in 2022 to $103 million in 2023.

On a non-GAAP basis, analysts still expect Datadog's EPS to rise 21% this year. However, its stock isn't cheap at 83 times its forward non-GAAP earnings.

The winner: Palantir

Palantir and Datadog will both likely remain volatile in this choppy market. But if I had to pick one over the other, I'd buy Palantir -- its GAAP profits are climbing, its stock is cheaper, and it has a more balanced exposure to the government and commercial sectors.

Datadog still has a bright future, but I'm not sure the market will fully embrace its strategy of spending heavily into a slowdown until the macro environment stabilizes.