It's been an ugly year for tech stocks. The bear market has taken a sizable toll, but July and August provided a little reprieve. The Nasdaq Composite index has rallied substantially off of its lows in mid-June. High-growth cloud communications platform Twilio (TWLO 2.94%) was left out, though. Shares remain down nearly 70% so far in 2022, and haven't budged off their lows.

TWLO Chart

Data by YCharts.

This is in spite of Twilio significantly beating its outlook for the second quarter of 2022. For the right investor, this could spell opportunity. Twilio could be a fantastic buy right now.

When beating guidance just isn't enough

The big highlight in Twilio's Q2 update was the biggest-ever deal for its Flex product -- a cloud-based contact center solution that combines messaging, video, email, and the like. Twilio said an existing Fortune 100 retailer customer signed an eight-figure deal to provide a unified communications suite for shoppers and company reps.

The size of this new business helped Twilio haul in $943 million in revenue in the quarter, a 41% year-over-year increase (or up 33% on an organic basis, which excludes revenue from acquisitions in the last 12 months). This handily beat management's guidance for revenue to be as high as $922 million and organic growth to be up only 29%.

What's particularly impressive is Twilio pulled this off in spite of rapidly decelerating economic growth, foreign currency headwinds, and many businesses slowing down their pace of spending on new projects. CEO Jeff Lawson attributed Twilio's stellar performance to the fundamental need for customers to update their communications tools for the cloud era. And as for the lack of foreign currency exchange rate issues that have plagued other tech companies, management said Twilio has a hedging program in place to mitigate effects of the U.S. dollar's historic run-up.

Adjusted loss from operations was $312 million (or a loss of $7.3 million on an adjusted basis, more on that in a moment). On an adjusted basis, this loss also handily beat management's expectations for losses as steep as $40 million.

Despite this outperformance, the market replied with a shrug. Twilio stock remains down in the dumps right now.

What's eating Twilio stock?

Twilio may have been left out in the cold by the recent market uptick because it still isn't profitable. With the global economy still on shaky ground and the U.S. Federal Reserve aggressively raising interest rates to try to tame inflation, companies that don't yet turn a profit are out of favor -- and are likely to remain that way for a while.  

Lawson and company have said they expect adjusted operating income to turn positive in 2023 and apparently aren't backing down from that guidance. The third-quarter outlook is calling for year-over-year organic revenue growth of 29% to 30%, and adjusted operating losses of as much as $70 million. The good news is Twilio had over $4.39 billion in cash and short-term investments, offset by debt of just $987 million. Nevertheless, investors want to see black below the bottom line, and Twilio remains in the red for now.  

There's an additional issue: Stock-based compensation paid to company executives and employees was a whopping $397 million through the first half of 2022. Stock-based compensation is indeed a legitimate business expense, but it's a noncash expense. So what's the issue? It dilutes existing shareholders' stake in the business. Twilio's stock-based comp was 22% of revenue through the end of June 2022, a high rate for a business of this size. It's a way the company finds and retains talent, but it's a big drag on shareholders betting on a big payoff long term.

How can investors assess the effects of stock-based comp on their growth stocks? I like to use revenue per share and gross profit per share up until the point a company turns profitable. This metric helps include the effects of new share issuance and provides some clarity on real flow-through of business growth to shareholders. Though Twilio has been issuing gobs of new stock, it's nonetheless still delivering growth for its owners.

TWLO Revenue (TTM) Chart

Data by YCharts.

Don't get me wrong; I expect Twilio to eventually develop into a company that turns profitable, eases way up on stock-based compensation, and longer term, begins returning excess cash to owners. But that's a long way off -- especially as long as Twilio can continue generating revenue growth of around 30%. 

That's why I believe Twilio to be a great buy right now. Shares trade for just 3.4 times enterprise value to trailing-12-month revenue. For a company expanding this quickly, it could be a depressed valuation, especially if Twilio does start turning a profit next year. Just bear in mind this will likely remain a highly volatile stock for some time, and patience will be required. Only investors who can afford to wait for at least a few years (but the more the better) should own Twilio -- and at that, I'd advise being prudent with those purchases.  

However, if you believe cloud computing-based communications are the future, Twilio could still have a very long runway of expansion ahead of it. I'm a buyer at these levels.