It's been challenging to hold Alibaba's (BABA -4.76%)stock over the last two years as it lost more than 70% of its market value.

As the stock price fell, investors questioned whether Alibaba had reached its prime and was bound to decline further. Still, I decided to hold on to the stock as the company worked through its issues.

While it's still early, Alibaba's latest earnings result justifies my earlier decision.

Person thinks about their investment.

Image source: Getty Images.

Alibaba's latest performance wasn't that bad

It wasn't pretty when Alibaba reported one of its worst-ever performances in the first quarter of the fiscal year 2023, which ended on June 30. Revenue came in flat while net income fell 53%.

Investors expected the second quarter to be equally tough as the tech conglomerate faced challenges such as COVID-19 lockdowns in China and the weakening external environment. But when Alibaba announced its result, I was somewhat surprised by its resilient performance.

As a start, revenue came in higher by 3% year over year. While its e-commerce business reported a marginal decline of 1%, other segments like local consumer services and Cainiao (logistics) reported robust growth of 21% and 36%, respectively. Besides, while the cloud computing segment reported meager 4% growth, revenue from non-internet-related industries (such as financial services, telecommunication, and public services) grew 28% year over year.

Alibaba's latest performance showed the resilience of its business model thanks to its diversified income base. When one segment underperformed, the remaining took over to keep the growth machine spinning.

Granted, Alibaba's group-wide revenue growth of 3% significantly underperformed its past rate of high-double-digit growth. Longer term, however, I think the company can resume a higher growth trajectory (more in the sections below).

Alibaba is moving in the right direction

It is not a secret that Alibaba is facing a tough time amid issues such as intensifying competition (from Pinduoduo and Douying) and weak consumer sentiment amid ongoing COVID-19 lockdowns in China.

Fortunately, the tech company is not sitting idle. For example, it launched Taobao Deals to compete against Pinduoduo in the lower-end segment. Also, it continuously strives to improve customers' shopping experience in Tmall and Taobao -- which may help explain the 98% retention rate for consumers spending more than 10,000 yuan per year in the recent quarter.

And when the external environment became more challenging for growth, the management team turned inward to improve its efficiency and cost structure. As a result, operating income surged 68% in the latest quarter to 25 billion yuan ($3.5 billion). As a reminder, revenue grew at just 3%.

I don't think Alibaba is entirely out of the woods. Still, I find it comforting that the management team is taking the proper steps to position the company for a better future.

Alibaba is buying back shares

It will take some time for the management team to right the ship. In the meantime, the company is buying back a lot of stock.

As of Nov. 16, the company has repurchased $18 billion worth of stock (under its $25 billion repurchase program). The board further increased the program by $15 billion and extended it to fiscal year 2025.

In other words, Alibaba can repurchase up to $22 billion worth of stock in the next few years. To put this figure into perspective, the company has a market capitalization of $213 billion (as of this writing). If the stock price remains unchanged in the coming months and assuming Alibaba uses up the $22 billion, the tech company will have repurchased around 10% of its stock.

And while $22 billion may look like a lot of money, Alibaba has more than enough cash on its balance sheet to fund the share buyback. As of September 2022, it has 485  billion yuan ($68 billion) in cash and cash equivalents, short-term investments, and other treasury investments.

Is it time to buy the stock?

Alibaba has been through a tough time lately, which was evident in weaker performance in the last few quarters.

Still, early green shoots indicate that the worst might be over soon -- revenue grew again this quarter, and profitability improved. As a shareholder, I think this positive trend is sustainable in the coming quarters. Hence, I'm holding on to the stock.

But I will not advise new investors to come on board now since I foresee more volatility in the coming months. They should monitor Alibaba's performance for a few more quarters before making their next move.