By one measure, Facebook just made Alphabet CFO Ruth Porat look like a spendthrift

Alphabet CFO Ruth Porat has gotten a lot of credit from investors for reining in spending on Google's experimental businesses.

But by one key measure, Facebook CFO David Wehner did a much better job during the second quarter.

Facebook's operating margin, or what percentage of revenue is left after deducting expenses, was 47.2 percent, vs. 26.4 percent for Alphabet

David Wehner, Facebook CFO

Source: Facebook

As measured by one key number, Facebook CFO David Wehner made Alphabet CFO Ruth Porat look like a profligate spender in the second quarter.

Facebook's second quarter operating margin, or the percentage of revenue left after deducting expenses, was 47.2 percent.

That was far better than Alphabet's margin of 26.4 percent.

(The Alphabet figure excludes the impact of the $2.74 billion European fine that was a big drag on its profit growth for the period.)

Wehner tightened down expenses even as Facebook generated revenue growth of 45 percent, more than twice Alphabet's rate of 21 percent.

That combination of surging sales and slowing expenses

, on the other hand, fell the day after .

To some degree, the divergence is simply because Alphabet is five years older than Facebook, and books almost 3x as much revenue -- $26.01 billion, vs $9.32 billion for Facebook in Q2. Facebook is starting from a lower base, so doesn't have to spend as much to generate growth as Alphabet does.

But the favorable comparison is not set in stone and could even go negative for Facebook in the second half.

Ruth Porat, CFO of Alphabet, at the New York Economic Club on May 22, 2017.

Adam Jeffery | CNBC

Wehner warned analysts on a conference call late Wednesday that the company's expenses would be higher later this year -- even as he lowered the full-year expense forecast range to 40 to 45 percent from 40 to 50 percent.

"I would note that we expect to accelerate our head count growth rate in the second half of the year, as we remain solidly in investment mode. We also expect that our video content investments will contribute to operating expense growth in the second half of 2017," Wehner said in his prepared remarks.

And by another financial metric, Porat did a better job than Wehner in the second quarter.

Operating expenses for Alphabet (again excluding the fine) rose 23 percent from a year earlier, while Facebook's jumped 33 percent.

That performance should help bolster Porat's reputation on Wall Street as the executive who is reining in spending on Google's more experimental businesses.

It also helps further explain what Porat meant when she said on her conference call with analysts late Monday that Alphabet was focused on dollar growth in revenue and operating income, rather than margins.

Since Porat joined Google (now Alphabet) on May 26, 2015, its shares have surged 76 percent, far more than the broader market for tech stocks, as measured by the Nasdaq Composite Index. By way of comparison, since Wehner took over as Facebook CFO in June 2014, Facebook shares are up 150 percent.