A glance at year-to-date performance suggests that cybersecurity specialist Fortinet (NASDAQ:FTNT) has won over investors, particularly compared to peer Palo Alto Networks (NYSE:PANW). Fortinet shareholders are enjoying a 22% bump in value in 2017, while Palo Alto has struggled to eke out a 5% gain.

After Fortinet's recent second-quarter earnings results, its stock has since nosedived 9%. As for Palo Alto, its quarterly release scheduled for Aug. 31 will help determine if CEO Mark McLaughlin has it heading in the right direction. As for which is the better buy -- Palo Alto or Fortinet -- for a number of reasons, there is a clear-cut answer.

Digital picture of a key protected by an electrical field of multiple data points.

Image source: Getty Images.

The case for Palo Alto

Palo Alto's stock has eased somewhat since sharing a pleasantly surprising fiscal third quarter, the initial bullishness was warranted. The days of 50%-plus quarterly revenue growth are long gone, but Palo Alto's 25% jump in sales to $431.8 million beat both its own and pundits' expectations.

The good news didn't end with Palo Alto's top line, either. Deferred revenue, a key metric as Palo Alto works to increase subscription-based software and service sales, soared 51% last quarter and now sits at $1.6 billion. The icing on Palo Alto's third quarter was revenue guidance of a 20% to 23% increase for this quarter of between $481 million to $491 million.

As impressive as its top line was, it's the ever-so-slight improvement in spending that gives Palo Alto bulls something to hold onto. Yes, operating expenses climbed in the third quarter, but the 18% rise to $357.2 million was actually less than what had become Palo Alto's norm.

Sales costs are still a thorn in Palo Alto's side, but last quarter's 16% jump to $226.9 million -- more than half of its total revenue -- was a baby step in the right direction and in line with McLaughlin's mandate to curb spending. With year-end results scheduled in a couple weeks, investors should keep an eye on whether Palo Alto is continuing to make strides in what has become a critical initiative: paring back overhead.

The case for Fortinet

Despite its stocks poor performance since sharing second-quarter results, Fortinet is hitting on all cylinders. Similar to Palo Alto, Fortinet is also shifting to a subscription-based, recurring revenue business model, and it's working beyond expectations. Building a foundation of ongoing revenue takes time, and the result is often slower, but steadier top-line growth. But that's not the case with Fortinet, as it demonstrated again last quarter.

The $363.5 million in second-quarter revenue was a 17% improvement and beat pundit's estimates. So, why the 9% drop in Fortinet's share price since sharing the good tidings? Revenue guidance for the current period between $367 million and $373 million disappointed, though, at the midpoint of Fortinet's forecast, it would equal another 17% rise in sales.

Revenue aside, Fortinet's management of overhead and service-related sales were the highlights of last quarter. Operating expenses inched up a mere 3.6%, which in turn led to an eye-popping per-share profit of $0.13 compared to a loss of $0.01 a share last year.

Fortinet's service-oriented sales jumped a whopping 26% to $220.8 million. Better still, at "just" 61% of total sales, Fortinet has plenty of room to increase its recurring revenue foundation, making it an even more stable, relatively predictable performer investors can rely on.

The envelope, please

As it stands, Palo Alto appears to be in the early stages of getting a handle on spending and slowly becoming a more efficiently run organization. However, it will take more than one so-so quarter before Palo Alto warrants a nod over Fortinet. Why? Because Fortinet is already a lean, mean profit-generating machine that is becoming stronger with each successive quarter, and that's why Fortinet is the better buy.

Tim Brugger has no position in any stocks mentioned. The Motley Fool recommends Fortinet and Palo Alto Networks. The Motley Fool has a disclosure policy.