In a year when U.S. restaurant chains have bemoaned sluggish traffic, competition from supermarket food and even the chilling effect of the presidential election, one area has continued to thrive: pizza.

Shares of Domino's Pizza are up 45 percent this year. And Papa John's International is up more than 60 percent. Compare that with a 3.4 percent gain for the Standard & Poor's 500 restaurants index.

The reasons are pizza is cheap, fast and increasingly easy to get — thanks to user-friendly mobile-ordering apps and technology that lets diners order from Facebook, Twitter and Apple TV. That's helped insulate pizza chains from a shift away from eating out.

"Restaurants that have succeeded this year have been the ones that have addressed convenience," says Stephen Anderson, an analyst at Maxim Group. "The pizza chains have done a good job at this."

The U.S. restaurant industry has largely been mired in a slump. Some have blamed negativity around the election, and now uncertainty about the president-elect's planned policies on issues such as immigration and minimum wage. Cheaper wares at supermarkets, driven by food deflation, also are enticing Americans to save a buck by cooking at home. Yet, diners' pizza habits haven't been hurt.

Domino's same-stores sales gained 13 percent in the U.S. last quarter, while Papa John's sales climbed 5.5 percent by that measure in North America.

Fast-food and fast-casual rivals have tried to follow suit, but getting a later start on technology has put them behind. McDonald's, the world's biggest restaurant company, said last week it's testing delivery service at about 200 Florida locations. It also still doesn't have a nationwide loyalty program, which pizza chains have used to keep customers coming back.

Wendy's says it's working on mobile ordering. And while Panera Bread offers so-called Rapid Pick-Up, where customers can order ahead and quickly grab food off a dedicated shelf, the technology is still a far cry from the likes of Domino's.

Domino's said earlier this week that customers can now order through Google Home. It's the fifth ordering method to be added this year. Diners also can request Domino's food through Twitter and Facebook. The chain's rewards program, introduced last year, lets customers get a free medium pizza for every six orders. Its newest gimmick: Rewards members can win shares of Domino's stock through next November.

Pizza companies also have aggressively advertised cheap deals to lure budget-conscious diners. Domino's has a two-for-$5.99-each menu, while Papa John's is promoting two large pizzas for $8 each.

"There's been a lot of competition," said Ivan Feinseth, an analyst at Tigress Financial Partners. The pizza chains have "promoted the value pricing well, and they have incorporated technology to make the buying process really convenient and fun."

Papa John's is riding the same ease-of-service wave. More than half of its orders are placed online. Couch potatoes can even get pizzas and special offers — like 25 percent off a purchase — while watching movies on Apple TV.

Pizza Hut, which is more of a sit-down restaurant chain, has largely lagged Domino's and Papa John's. Its same-store sales dropped 1 percent last quarter. But the business is moving toward speedier, more convenient service. The division of Yum Brands Inc. is remodeling older locations to focus more on to-go orders and delivery.

"The business is moving more to off-premise or to a faster dine-in experience," said Yum's Chief Financial Officer David Gibbs.

The challenge for casual-dining chains like Pizza Hut is that they weren't designed to deliver, he said. "They were built at a time before delivery was introduced."