Image source: Baidu. 

Shares of Baidu (BIDU 0.34%) and Amazon.com (AMZN -2.76%) have been some of the Internet's biggest winners for long-term investors. Amazon is a 15-bagger over the past decade, and Baidu stock is a 30-bagger in that time.

As big as the world's largest online retailer may be, Amazon stock still managed to more than double last year. Baidu shares actually slipped in 2015, but that's only the third time that investors have experienced an annual decline since the leading Chinese Internet search company went public 11 years ago.

Amazon and Baidu have been rock stars in the past, but which one is the better bet for the future? Let's start off by weighing in with the recent growth at both companies. The two dot-com speedsters aren't expanding their top lines at the same heady percentage clips of their youth, but they're both holding up exceptionally well. Amazon's revenue climbed 20% in 2015 with a 21% annualized rate over the past three years. Baidu is growing even faster with its revenue rising 35% last year, clocking in with an annualized rate of 44% over the past three years. 

Earnings growth hasn't been as consistent at either Amazon or Baidu. Both companies are investing in online endeavors that won't pay off right away, and that is translating into lumpy profitability. Wall Street's been lowering their profit forecasts for both companies as a result of their fence-swinging ways, but each company has still managed to beat analyst income estimates in three of the past four quarters. That makes it harder to run the two stocks through the next phase of this battle -- valuation -- but it's a necessary step in any buying decision.

Baidu is trading at 28 times this year's projected profitability. If we look out to next year's profit target the multiple drops to 21. Amazon is fetching a sky-high earnings multiple of 124 based on Wall Street's estimates for 2016, but that is nearly shaved in half to 66 if we look out to next year. This would seem to give the valuation round to Baidu, but we can't ignore that Amazon's bottom-line results are sandbagged by its margin-squeezing digital and hardware initiatives. There's a price to be paid by practically giving away namesake tablets, e-readers, and voice-controlled computing devices.

In terms of risk, it's hard to ignore that Baidu toils away in China. The world's most populous nation has an inconsistent track record when it comes to online censorship, and while it would send shock waves through China's global trading partners if it were to ever crack down on its dot-com darlings the risk is certainly out there. One can also rightfully argue that Amazon has the bigger moat. Baidu may command roughly two-thirds of the search queries in China, but there are plenty of big tech companies gunning for Baidu's business in mobile and desktop search. Amazon has spent two decades padding what could very well be an insurmountable lead in e-tail given its base of tens of millions of Amazon Prime customers and global reach in terms of fulfillment.

The future is bright for both companies. They have succeeding in transforming their dominant online niches -- online retail for Amazon and search in China for Baidu -- into much broader businesses, making them two of the biggest success stories of the dot-com generation. Baidu may seem cheaper, and Amazon may seem less risky, but both have the right ingredients to continue to beat the market for the long haul.