Tesla (TSLA -1.51%) and Nvidia (NVDA 2.00%) have been big winners in the stock market over the past decade as shares of these high-growth companies have soared impressively thanks to the booming demand for their products. But the broader stock market sell-off has sent these stocks packing in recent months.

Nvidia stock is down close to 60% in 2022, and Tesla has slipped 40%. There could be more pain in the cards for them from surging inflation and macroeconomic headwinds. The Federal Reserve is expected to hike interest rates once again to get a handle on inflation, indicating that the stock market could remain under pressure in the near term. And there are concerns that the demand for Tesla's and Nvidia's products is sliding.

These factors could send shares of both companies lower in the short run. However, that could open an opportunity for savvy investors to buy these long-term winners on the cheap. So which growth stock should investors be buying?

Tesla is racing ahead

Tesla's third-quarter results were released on Oct. 19, and the gap between the company's vehicle deliveries and production seems to have created doubts on Wall Street about the demand for its products. The electric vehicle (EV) maker produced almost 366,000 vehicles last quarter but delivered nearly 344,000. The company's deliveries usually exceed production, but for the last two quarters, it has produced more cars than it has delivered.

That explains why analysts are concerned about a drop in demand for Tesla EVs amid the broader economic slowdown. But a closer look shows that Tesla doesn't have a demand problem. Rather, the company is facing logistics constraints and saw an increase in cars in transit for delivery at the end of the previous quarter. CEO Elon Musk also said on the latest earnings conference call that the company is "looking forward to a record-breaking Q4."

And it reported terrific growth last quarter. Revenue jumped 55% over the prior-year period to $18.7 billion, and adjusted earnings increased 69% to $1.05 per share. Consensus estimates suggest that Tesla could finish 2022 with a 55% jump in revenue to $83 billion. Earnings are expected to spike 80% to $4.08 per share.

Musk says that Tesla could "sell every car that we make for as far in the future as we can see." The rapidly growing adoption of EVs works in his favor, as the company continues to focus on capacity expansion, and aims to increase deliveries by 50% annually over the long run.

These tailwinds indicate why Tesla is expected to generate over $146 billion in revenue by 2024 and increase its earnings at an annual rate of 53% over the next five years. This EV stock looks all set to step on the accelerator in the long run, so investors might want to take a closer look at it while it is still down.

Nvidia is in a rut

On the other hand, Nvidia's growth has fallen off a cliff because weak demand for personal computers in 2022 has wrecked the company's gaming business. And the restrictions imposed by the U.S. government on sales of semiconductors to Chinese customers are going to be another headwind for the chipmaker.

All this explains why Nvidia's growth in its ongoing fiscal 2023 is forecast to come to a screeching halt. Analysts aren't expecting revenue to grow this year, while its earnings are on track to contract significantly.

But Nvidia could regain its mojo thanks to multiple catalysts, such as the growing adoption of graphics cards in data centers and cars, as well as new opportunities in emerging areas like cloud gaming, digital twins, and server processors.

This explains the 23% annual growth Nvidia is expected to deliver over the next five years. But its turnaround is likely to take time, as the demand for personal computers could remain muted in 2023.

And Nvidia's valuation is on the expensive side considering the sharp decline in the company's growth. It trades at 10.6 times sales and 41 times trailing earnings. Tesla, on the other hand, has a similar price-to-sales ratio, even though it is growing at a much faster pace right now. Of course, Tesla trades at an expensive 77 times trailing earnings, but its growth can justify that. And the EV manufacturer's forward earnings multiple of 37 points toward a sharp jump in the bottom line.

In the end, Tesla looks to be in red-hot form, and it could sustain that, while Nvidia will take time to come out of the rut it is in right now. All of this makes Tesla the better growth stock.