The first half of the year has come to a close, and investors in growth stocks have reason to smile. Many of these players -- after struggling in 2022 -- have rebounded. In fact, they've done more than that. These stocks actually have led the market rally since the start of the year.

Technology and consumer discretionary stocks contributed the most to the S&P 500's 15% gain in the first six months, according to Statista. These sectors include many growth stocks, or companies expected to increase earnings more quickly than the general market. Now, the question is whether you should continue to buy growth stocks at this point -- or if it's too late. Let's find out.

Growth stocks in 2022

So, what happened to growth stocks last year? In an environment of rising interest rates and concerns about the economy, these players underperformed. Why? For a couple of reasons. High growth companies often have to borrow to expand -- so rising interest rates, which add to expenses, isn't good news. These companies also represent some risk in a tough economic environment. That's because they generally depend on consumer spending and economic growth. As a result, in tough economic times, investors may not pile into growth stocks.

That said, today's economic situation remains difficult -- yet these stocks are leading market gains. But there are two key things happening here. First, some growth companies have proved that they are managing the economic environment and recovering from earlier difficulties.

A great example is Amazon (AMZN -0.86%). The company swung to its first annual loss in nearly a decade as it struggled with higher costs, too much capacity, and other challenges. But its effort to improve its cost structure is working. In the most recent earnings report, Amazon reported growth in operating income and improvement in its outflow of cash.

Second, investors are looking ahead to what's next and trying to prepare. And that's a bull market. We don't know when it will arrive, but it's coming. History shows us bull markets always follow bear markets. And in bull markets, growth stocks tend to outperform.

A sign of investor optimism

Proof that investors are more and more enthusiastic about investing? The Chicago Board Options Exchange Volatility Index -- generally referred to as the VIX -- has been on the decline. The VIX measures expectations for stock market volatility. And a low reading signals investor optimism.

VIX Chart

VIX data by YCharts

Now let's get back to our question. Is now a good time to buy growth stocks? Yes -- but only if you consider these players on a stock-by-stock basis. What I mean is it isn't a good idea to buy a basket of growth stocks just because they have momentum. Instead, it's important to consider a particular stock and its valuation -- and determine whether it's gone too far too fast or if the stock still holds long-term potential.

As we head toward a bull market, it's a great idea to add some solid growth stocks to your portfolio. And even though many have climbed, opportunities and bargains still remain. I'll mention Amazon again, but this time with a focus on valuation. The stock today trades at 2.5 times sales, down from more than 4.8 just a few years ago. So it isn't too late to get in on this e-commerce and cloud computing giant.

Of course, the path to long-term gains isn't a straight line. A black swan event at some point in time could shake things up -- as we saw with the pandemic. And economic and market downturns could interrupt the good times too. But, if you invest today for the long term -- a period of at least five years -- and you choose solid players, you're likely to win over time.