If you hold on to a promising growth stock for five years, you should expect to accumulate some decent gains over that time. Investing in just the S&P 500 would have resulted in a nearly 60% increase in value -- and that's even after factoring in this year's bearish market.

Five years ago, Vertex Pharmaceuticals (VRTX 1.25%) was coming off a year when its revenue soared by 65% to $1.7 billion. Although the business was unprofitable, Vertex's losses were shrinking, and it was looking like a top growth stock to own. Here's a look at how it has performed since then and what a $25,000 investment back then would be worth today.

Growth has continued, and the business is now profitable

In the past five years, Vertex's top and bottom lines have been moving in the right direction:

VRTX Revenue (Quarterly) Chart.

VRTX Revenue (Quarterly) data by YCharts.

The dip in profit last year was due to a $900 million up-front payment the company paid to CRISPR Therapeutics related to a collaboration between the two businesses. That spiked Vertex's research and development costs during the period. However, the overarching theme is that of a growing, more profitable business over the past five years. For 2022, the company anticipates full-year revenue of around $8.5 billion, which would represent a year-over-year increase of 12%.

Vertex's core business focuses on treating cystic fibrosis, but it also has an exciting opportunity with CTX001, which is the collaboration noted above that involves CRISPR. It believes that the gene-editing therapy could be a multibillion-dollar opportunity that could help approximately 32,000 patients with severe cases of beta thalassemia and sickle cell disease. The companies are planning to submit a request for the treatment's approval from the Food and Drug Administration before the end of this year. 

Investing in Vertex would have proven a great move

You could have bought shares of Vertex five years ago for a price of around $130. Investing $25,000 would have allowed you to acquire approximately 190 shares. Since then, the stock has more than doubled to a value of $275. At its current valuation, that investment would now be worth over $52,000.

In other words, the stock has soundly outperformed the S&P over the past five years. Now, let's look ahead.

Should you buy Vertex Pharmaceuticals today?

This year, Vertex has continued its market-beating ways, rising more than 25% in value year to date while the markets are well into negative territory. In addition to some great growth numbers, what I love about the business is that it generates incredible margins:

VRTX Gross Profit Margin (Quarterly) Chart.

VRTX Gross Profit Margin (Quarterly) data by YCharts.

At more than 85% of revenue, its gross margins are impressive. It's little surprise that the company's bottom line has been rising along with revenue over the past five years, and that's why it can continue performing well in the years ahead.

Even if you could cash out an investment in Vertex from five years ago, it may not be an optimal decision given that the company still has more potential growth on the horizon. Vertex is one of the best healthcare stocks out there today, and it's a safe investment that you can hang on to for many years.