The stock market is a powerful tool for generating wealth over long periods of time. With returns averaging about 10% each year, you might reasonably expect to double your money about every seven years by simply holding on to a diversified index fund.

But some investments get there much more quickly.

High growth rates, combined with rising profitability, can form the foundation for returns that trounce the broader market. Below, we'll look at a few stocks, Boston Beer (NYSE:SAM), Okta (NASDAQ:OKTA), and RH (NYSE:RH), that have used these trends to jump by roughly 500% in the past three years.

A man and woman holding cash.

Image source: Getty Images.

1. Boston Beer: Making product-line adjustments

Three years ago, Boston Beer was enduring a rough patch in its business. Beer sales volumes declined in fiscal 2017 as core brands like Samuel Adams and Angry Orchard lost ground to the flood of microbreweries that had entered the craft beer space. These shrinking franchises were only partly offset by growth in non-traditional beverage brands like Twisted Tea and Truly Hard Seltzer. Sales that year dipped 5% to $863 million.

But the company was onto something with its non-beer beverages, which went on to power huge growth. Volume jumped 39% this past year, led by surging demand in both the Truly and Twisted Tea franchises. Boston Beer led the broader industry in growth in 2020, with annual sales crossing $1.7 billion.

The stock's prospects seem more challenged after the 500% run-up since April 2018. Every major beer brewer has competing products on the market today, and that crowded industry has Boston Beer projecting weaker profitability over the short term. But it would still be a mistake to bet against a company with a proven track record for innovation and a dominant hold on the market's fastest-growing niche.

2. RH: Spiking profitability

Luxury home furnishings specialist RH was already performing well three years ago. Fiscal 2018 sales rose 5% compared to a 12% spike in the prior year, thanks to steady market share gains in its core categories. RH's profitability told an even more positive story, with margins hitting a new record that year of 12%.

Things have gotten much better since then. Last year, with support from booming demand in the home furnishings industry, RH's sales rose 8%. Profit margin jumped by over seven percentage points, to a whopping 22% of sales. "It's an operating margin never seen before in the home furnishings market," CEO Gary Friedman told investors in March.

RH Operating Margin (TTM) Chart

RH Operating Margin (TTM) data by YCharts

The prospects are similarly bright for 2021, with sales and profitability each set to rise again. RH has its eyes on a much bigger prize, though, as sales eventually reach as high as $6 billion in the U.S. market alone. Revenue just touched $3 billion last year, so that's a long runway ahead.

3. Okta: Surging cash flow

Okta filed its first annual report as a public business roughly three years ago. The digital identity management business had some attractive investment characteristics back then, including a growing roster of enterprise clients and a big pool of recurring revenue. Yet it had just closed out its third straight year of net losses.

The next three years wouldn't change that negative earnings picture, but investors have been thrilled with Okta's brightening growth potential. Management can target a significant piece of an $80 billion market today, compared to the estimated $17 billion annual opportunity in its digital identity niche in 2017.

Cash flow trends are encouraging, too, as they give a better view into earnings power for a subscription-based cloud business. Free cash flow jumped to 13% of sales last year from 6% in the prior year and negative 2% in fiscal 2019. More steady gains in this figure should support positive investors' returns as Okta begins to generate positive net earnings over the next few years.

Wall Street pros are always hunting for the next obscure stock that can produce eye-popping returns. But in the case of Okta, RH, and Boston Beer, the best investment idea might be to simply stick with the winners.

This article represents the opinion of the writer, who may disagree with the “official” recommendation position of a Motley Fool premium advisory service. We’re motley! Questioning an investing thesis -- even one of our own -- helps us all think critically about investing and make decisions that help us become smarter, happier, and richer.