Alphabet (GOOG 9.96%) (GOOGL 10.22%) and Baidu (BIDU 0.62%) bear many striking similarities. Alphabet's Google owns the world's largest search engine, the third largest cloud infrastructure platform, and its most popular streaming video platform, YouTube. Baidu owns China's leading online search engine, a smaller cloud platform, and iQiyi (NASDAQ: IQ), one of the country's leading streaming video platforms.

Google and Baidu are both ramping up their investments in the artificial intelligence (AI) market to crunch more data and process more natural language requests. Google has been developing an AI chatbot called Bard and an AI large-language model called Gemini to challenge OpenAI's ChatGPT in the generative AI space. Baidu has developed a large language model called Ernie to power its own chatbot, and it's been integrating AI features into its Apollo platform for driverless vehicles.

Two androids in business suits meet in a high-rise office.

Image source: Getty Images.

Both tech giants are tightly weaving those AI features into their own search and cloud platforms. However, both companies still generate most of their revenue from online ads -- which leaves them vulnerable to the macro and competitive headwinds. So should long-term investors buy more shares of Alphabet right now or take a chance on its Chinese counterpart?

Alphabet's unbalanced recovery

Alphabet generated 78% of its revenue from Google's advertising business (including its search, network, and YouTube ads) in its latest quarter. That core business suffered a slowdown in 2022 as the macro headwinds drove many companies to trim their marketing budgets. However, its ad growth accelerated again over the past year as its sales of search engine and YouTube ads rose and offset its slower sales of network ads.

Alphabet generated 11% of its revenue from Google's "other" non-advertising businesses (including its subscriptions, a la carte services, and hardware devices) in its latest quarter, while the remaining 11% came from its cloud business.

Google's growth in "other" revenue accelerated over the past year as YouTube Premium and Music locked in more paid subscribers. It expects this segment to continue growing as it rolls out new Pixel devices in late 2023 and early 2024.

However, its closely watched cloud business suffered an unexpected slowdown in the third quarter of 2023 and grew at a slower pace than Microsoft's (NASDAQ: MSFT) Azure, which had been ramping up its AI investments over the past year. That gap spooked the bulls because Google Cloud still controls a much smaller slice of the cloud market than Azure.

Analysts expect Alphabet's revenue and earnings to rise 8% and 26%, respectively, in 2023. For 2024, they expect 11% revenue growth and 17% growth. Those are solid growth rates for a stock which trades at 21 times forward earnings.

Baidu faces similar challenges

In its latest quarter, Baidu generated 57% of its revenue from its online marketing business, which handles its search and display ads along with its managed business pages. That core business faced tough macro headwinds throughout 2022, but it recovered throughout 2023 as the market's robust demand for its managed pages, which empower Baidu to handle a brand's entire presence within its ecosystem, offset its slower sales of traditional search and display ads.

However, Baidu's non-online marketing businesses, which include its cloud platform and accounted for 20% of its revenue last quarter, suffered a slowdown and partly offset the stabilization of its marketing business. That deceleration was mainly caused by a slowdown in smart transportation projects across China, but it also faces stiff competition from its larger rivals -- including Alibaba, Huawei, and Tencent -- in the country's crowded cloud platform market.

Its streaming platform iQiyi, which accounted for the remaining 23% of its revenue last quarter, continued to grow as it locked in more paid subscribers. Its operating margin is also expanding as it reins in its spending and expands its higher-margin membership plans to reduce its dependence on lower-margin ads for its free viewers.

Analysts expect Baidu's revenue and earnings to grow 6% and 27%, respectively, in 2023. For 2024, they expect its revenue and earnings to rise 9% and 2%, respectively, as its three core businesses stabilize in a warmer macro environment. Baidu's stock looks cheap relative to that growth at 11 times forward earnings, but its valuations are being compressed by the tech war and the unresolved delisting threats for U.S.-listed Chinese stocks.

The better buy: Alphabet

Alphabet and Baidu are both promising long-term investments. But I believe Alphabet's superior scale, geographic diversification, and stronger near-term growth make it a better buy than Baidu right now. Baidu's stock looks cheaper, but it will continue to trade at a discount until the market's appetite for Chinese tech stocks improves.