2022 saw the S&P 500 index lose close to 20% of its value as the Federal Reserve hiked interest rates in an effort to get outsized inflation under control. 2023 has so far seen the stock market make some real efforts at recovering some of those losses. By the end of the year, don't be surprised to see the market hit new highs if the Fed succeeds in tamping down inflation and stops raising rates.

A Reuters poll suggests the market sentiment is that the S&P 500 could end the year at higher levels than where it was at the end of February, even if there is a near-term correction. It is also worth noting that inflation in the U.S. is expected to cool to a range of 2.8% to 3.5% this year as compared to last year's Consumer Price Index (CPI) inflation range of 7% to 8.1%.

All this means that the likelihood of a stock market bull run in 2023 cannot be ruled out, which is why investors may want to buy shares of Twilio (TWLO 2.40%) before that happens. Let's look at the reasons why.

Twilio's earnings are set to increase at a red-hot pace

Twilio released its fourth-quarter 2022 results on Feb. 15. The cloud communications specialist reported adjusted earnings of $0.22 per share, which was a huge jump over the prior-year period's loss of $0.20 per share. Its Q4 revenue increased 22% year over year to $1.02 billion. Analysts would have settled for $1 billion in revenue and an adjusted loss of $0.09 per share.

The company's big bottom-line improvement was driven by a combination of strong revenue growth and a reduction in the employee count to control costs. Additionally, Twilio took steps to bring stock-based compensation under control in a bid to improve profitability and it also announced a share repurchase program worth $1 billion.

The company also decided to bifurcate its business into two divisions -- communications and data and applications -- so that it can focus on its aim of generating profitability and achieving growth simultaneously. The communications segment generated more than $3 billion in revenue last year thanks to Twilio's massive base of active customers, but the company hasn't generated profit consistently from this unit.

Twilio expects to generate a non-GAAP operating profit of $250 million to $300 million from this segment in 2023 by simplifying the sales structure and increasing customer engagement. Given that the communications business accounted for 88% of the cloud specialist's top line in 2022, its focus on improving the profitability of this segment is one of the reasons why analysts are anticipating a big spike in the company's earnings this year.

According to consensus estimates, Twilio could report adjusted earnings of $1.25 per share in 2023. For comparison, last year it posted an adjusted loss of $0.15 per share. Even better, the company's earnings could increase to $1.88 per share in 2024. Analysts are confident that Twilio could sustain its terrific growth for years to come, forecasting annual earnings growth of nearly 103% for the next five years.

Impressive upside could be in the cards

The cloud-based contact center market in which Twilio operates was worth $17 billion last year. The company's 2022 revenue of $3.83 billion suggests that it had a 22.5% share. This market is expected to generate almost $55 billion in annual revenue in 2027. So Twilio's annual revenue could hit $11 billion if it manages to hold a 20% share of this space. Throw in the company's focus on profitability, and it won't be surprising to see Twilio achieve the ambitious growth that analysts expect from it.

Analysts have a 12-month median price target of $83 on Twilio stock, which points toward a 12% upside from current levels. The Street-high price target of $110 based on a consensus of 29 analysts suggests that shares could jump 49% over the next year, which the stock seems capable of delivering considering the discussion above.

What's more, if Twilio's top line does hit $11 billion after five years, the company's market capitalization could increase to $38.5 billion based on its current price-to-sales ratio of 3.5. That would be nearly thrice its current market cap, indicating that this cloud stock could triple investors' money over the next five years.

As Twilio's current sales multiple represents a big discount to the five-year average multiple of 16, investors are getting a good deal on the stock right now, which they may want to grab with both hands considering the potential upside on offer in both the short and the long run.