Despite being the third-largest U.S. company, Alphabet (GOOG 0.74%) (GOOGL 0.55%)hasn't had a great year. The stock is down 31% this year, underperforming both the Nasdaq Composite and the S&P 500.

While this underperformance stings for this year, does it set the stage for outperformance next year? After all, you can't change the past, but you can invest in the future. So let's find out if Alphabet is set for a recovery in 2023.

How did we get here?

First, let's understand how Alphabet's 2022 went. Alphabet's fall can be associated with its concentration in the advertisement industry. With nearly 80% of its total revenue derived from advertisement sources, Alphabet is highly exposed. The advertisement business is historically cyclical; it rises and falls with the economy.

When times are good, businesses spend heavily promoting their products or services. When the outlook is grim, these entities pull back on their spending, as it's much easier to control advertising expenses than to lay off workers or cancel initiatives. In the third quarter, Alphabet's advertising revenue only grew by 2.5%, which is still impressive considering the headwinds Alphabet faced in Q3. Within this metric are two key findings.

First, Google search ads grew by 4.3%, indicating that its core product (Google search ads made up 57% of Alphabet's total revenue) is still seen as a required advertising location for many clients. Second, YouTube ads fell 1.9% in Q3, showing that social media ads don't drive the same return on investment that companies look for when purchasing ads.

Investors must watch how these numbers trend in 2023, as their direction will also guide the stock.

But there are a few other considerations to keep in mind.

Will hiring and expense growth slow?

Another critical metric from Alphabet's Q3 results was the number of employees hired over the past year. The headcount rose from 150,028 last year to 186,779 this year, a 25% increase. These new employees contributed to rising operating costs, particularly in research and development.

Operating Expense Q3 2021 Cost Q3 2022 Cost Percent Increase
Research and development $7.694 billion $10.273 billion 34%
Sales and marketing $5.516 billion $6.929 billion 26%
General and administrative $3.256 billion $3.597 billion 11%

Data source: Alphabet.

One item to bear in mind when examining research and development costs is that Alphabet's acquisition of cybersecurity firm Mandiat (formerly known as FireEye) closed, which added 2,600 new personnel to Alphabet's count. Still, even though I wouldn't say I like rising expenses, where it is spending its money is encouraging, although I wish it were at a lower rate.

First, Alphabet sees an opportunity in artificial intelligence, cybersecurity, and data centers, so it is investing heavily in these initiatives in exchange for lower profitability.

Second, many companies cut advertising and sales expenses during difficult economic periods because they cannot afford to do it or are being fiscally conservative. With the less saturated advertising market, if you can afford to advertise, the ads will be more effective because there is less competition. Alphabet understands this and is ramping up spending to capture more market share.

Finally, general and administrative didn't rise at the same pace as more essential segments. That's key, because it shows Alphabet isn't getting more top-heavy.

Still, management stated on its conference call that it intends to slow the pace of hiring in 2023. I think that's a wise move, and Alphabet's profitability should stabilize or improve.

While I'm still critical of Alphabet's expenses, the company still posted an impressive 20% profit margin in Q3, something many companies can't say.

Is Alphabet the top stock to buy in 2023?

Despite Alphabet's rising costs, which affect earnings, the stock still trades at historically low valuations.

Chart showing Alphabet's PE ratio and price to free cash flow falling since 2018.

GOOG PE Ratio data by YCharts

If the economy recovers in 2023, I'd expect Alphabet shares to rocket higher due to the influx of advertising spending. If it doesn't, but Alphabet maintains its revenue streams, the stock will likely stay flat where many others will sink. With Alphabet still trading at a valuation low and with other growth initiatives like cloud computing, the future is bright for both Alphabet's stock and business.

However, I have no idea if 2023 will be when Alphabet turns it around. Still, I understand the business is in a temporary downturn and that for long-term shareholders, Alphabet will likely provide market-beating returns when assessed from a three- to five-year timeframe. Alphabet is a strong buy, and investors shouldn't wait until 2023 to purchase shares.