Soaring inflation and the government's response to it has helped send the S&P 500 into bear market territory. In response, many investors are making changes in their portfolios, looking to add consumer staples and energy stocks. Food and fuel are necessities, so those sectors tend to outperform during market downturns. However, both sectors have still dramatically underperformed the broader S&P 500 over the past five years.

That underperformance suggests that it makes more sense to look for bargains among the beaten-down growth stocks. Businesses like Cloudflare (NET -3.01%) and HubSpot (HUBS -2.82%) provide critical services for their clients. That means both businesses should continue to grow throughout the inflation-driven downturn, and that should translate into a strong rebound during the next bull market.

Here's why you shouldn't hesitate to buy these growth stocks.

1. Cloudflare

Cloudflare operates a global cloud platform that accelerates and secures its clients' business-critical applications and infrastructure while eliminating the need for costly on-site hardware. Its portfolio also includes developer tools that help clients build fast, scalable software and websites. Many of those services are a necessity, even in an inflationary environment.

Cloudflare benefits from its freemium pricing model and vast global infrastructure. Its platform sits within 50 milliseconds of 95% of the internet-connected population, and it provides content delivery services to over 19% of websites on the internet. The next closest competitor has less than 2% market share. Of course, not all those users are paying customers, but Cloudflare uses its free tier to trial new products and accelerate product development.

Fueled by those advantages, Cloudflare is growing at a tremendous pace. Its customer base grew 29% to 154,000 in the past year, and the average customer spent 27% more. In turn, revenue soared 53% to $731 million. As a caveat, the company generated negative free cash flow of $105 million, but management is running the business near breakeven intentionally. Cloudflare has $1.7 billion in cash and short-term investments on its balance sheet, meaning it can afford to invest aggressively in growth.

On that note, management puts its addressable market at $115 billion in 2022, and the company is innovating rapidly to capitalize on that opportunity. Cloudflare recently launched R2 storage and announced its D1 database, both of which streamline application development on its platform. It also introduced Cloudflare for Platforms, a suite of tools that allows businesses to build programmable applications on its network. For instance, Shopify will use the service to make its e-commerce software more customizable for merchants.

That capacity for innovation should keep Cloudflare on the cutting edge of the cloud industry, and because cloud services help businesses operate more cost-effectively, Cloudflare's business should continue to grow through the current downturn. That doesn't mean the stock won't fall further, but it should drive a strong rebound at the onset of the next bull market.

Currently, Cloudflare stock trades at 17.7 times sales, well below its historical average of 43.1 times sales. That's why now looks like a good time to buy this growth stock.

2. HubSpot

Salesforce dominates the customer relationship management (CRM) space, but its platform is geared toward larger enterprises. In response, HubSpot has carved out its own niche with small- and medium-sized businesses (SMBs). Its platform includes productivity software for marketing, sales, and customer services, and solutions for content management, data integration, and workflow automation.

Collectively, those tools help clients attract visitors with engaging websites, social media content, and marketing material, then convert those visitors into loyal customers. HubSpot's freemium model and focus on SMBs helps it land clients, and its tiered pricing structure encourages clients to expand usage over time. That strategy has paid off in a big way.

In the past year, HubSpot increased its customer base by 26% to 143,600, and the average subscription revenue per customer climbed 12%, showing the efficacy of management's land-and-expand growth strategy. In turn, revenue soared 47% to $1.4 billion and free cash flow more than doubled to $188 million. Additionally, the company continued to grow its product portfolio with the launch of HubSpot Payments, a service that reduces sales friction by integrating digital transactions into its CRM platform.

Here's the bottom line: HubSpot is the CRM industry leader in the small business niche, and the CRM market is expected to grow at 13.3% per year to reach $158 billion by 2025, according to Grand View Research. That puts the company in front of a massive opportunity.

Moreover, CRM software plays a critical role in helping businesses build and maintain customer loyalty. If anything, that means CRM software is even more important during an inflation-driven downturn. That should keep HubSpot growing through the bear market, allowing the stock to rebound rapidly during the next bull run.

Currently, HubSpot stock trades at 9.7 times sales, markedly cheaper than its historical average of 12.6 times sales. That's why this growth stock looks like a bargain.