Investors who bought $50,000 worth of Berkshire Hathaway (BRK.A -0.76%) (BRK.B -0.69%) stock 20 years ago have seen their investment grow to more than $364,000 at recent prices. Over the same time frame, total returns from the S&P 500 index would have grown the same initial investment into a more modest $321,000.

Buffett's ability to outperform the market over a two-decade period is remarkable, but now that Berkshire Hathaway's book value is up around $540 billion, moving the needle forward is far more challenging.

Warren Buffett at a conference.

Image source: The Motley Fool.

Berkshire Hathaway probably isn't the best stock to buy now if you want to realize a tenfold gain over the next two decades. Luckily, there are at least two stocks in Berkshire Hathaway's equity portfolio that are poised to outperform in the decades to come.

1. Amazon

Amazon (AMZN 3.43%) is already a giant, with a staggering $1.43 trillion market cap at recent prices. Right now, you're probably wondering how in the world its stock price can be expected to increase tenfold over any length of time. Amazon has its fingers in some very lucrative pies and a long track record of turning challenges into new sources of growth.

Amazon got started selling stuff online, which required lots of data centers. Instead of just eating this expense, it began selling excess capacity and turned Amazon Web Services (AWS) into the world's largest provider of cloud computing services.

The $22.1 billion in cloud service revenue Amazon recorded in the second quarter is still just a tiny fraction of its addressable market. The global market for cloud computing reached $484 billion in 2022, and it's expected to rise by 14.1% annually through 2030, according to Grand View Research.

America's $4.3 trillion annual healthcare expenditure could be the next problem that Amazon turns into a huge source of growth. This August, Blue Shield of California hired Amazon to provide free and fast delivery of prescription drugs to most of its 4.8 million members.

While there's a chance Amazon can deliver a tenfold return over the next 20 years, investors should understand that this stock is kind of risky. At recent prices, it's trading at the nosebleed-inducing valuation of 63.6 times forward-looking earnings estimates.

Amazon's earnings multiple is appropriate for a stock growing by leaps and bounds, but trailing-12-month earnings have fallen more than they've risen over the past three years. Any signs of stagnation ahead could cause investors to lose patience and pound its stock price into the dirt.

2. Markel Group

Berkshire's performance has slowed down a lot over the past two decades. During the last 20 years of the 20th century, though, shares of Buffett's holding company soared 19,240%, or enough to turn an initial investment of $50,000 into about $9.7 million.

Like Berkshire Hathaway, Markel Group (MKL -1.00%) is first and foremost an insurance company, and a good one at that. It pays significantly less in claims than it collects in premiums. Those excess premiums create an essentially free source of capital that insurance companies call their float. Both Berkshire and Markel use their float to acquire businesses they control and publicly traded companies that they don't control.

These days, Berkshire is so big that it isn't easy finding acquisition targets that can move its needle forward. Markel Group has a book value of $13.6 billion at the moment, so finding deals that can really make a difference over the next couple of decades should be much easier.

We can't be certain Markel's stock will rise tenfold by 2043, but it's gaining a lot of steam. The company's collection of wholly owned businesses delivered 42% more operating income during the first half of 2023 than it did in the previous-year period.

At recent prices, you can buy Markel Group shares for just 7.7 times trailing free cash flow. This means even if profits stagnate, investors who buy now and hold on for the long haul can still realize annual gains at a double-digit percentage.

Markel Group reported 180% more free cash flow over the past 12 months than it did five years earlier. If its bottom line continues along this trajectory, its stock price activity could resemble Berkshire Hathaway's best decades.