Shares of Grubhub (GRUB) rallied nearly 40% this year, as the food pick-up and delivery service provider continued its streak of high double-digit sales growth. That momentum probably won't wane anytime soon -- analysts expect Grubhub's revenue and non-GAAP earnings to respectively rise 33% and 24% this year.

Back in February, I weighed several reasons to buy and sell Grubhub, but concluded that its rising expenses, slowing earnings growth, high valuation, and rising competition made it too risky to own. Do those same risks still outweigh the potential rewards? Let's take a closer look at the bull and bear cases for this stock to decide.

GrubHub's app.

Image source: GrubHub.

The bull case for Grubhub

Grubhub allows users to order takeout or delivery from over 55,000 restaurants in more than 1,200 U.S. cities and London. Its ecosystem includes its namesake app, Seamless, Restaurants on the Run, DiningIn, and Delivered Dish.

It also recently agreed to buy Yelp's (YELP 0.60%) Eat24, Groupon's (GRPN 0.57%) OrderUp, and Boston-based online delivery service Foodler. That growing portfolio supports Grubhub's position as the market leader in the online takeout and delivery space, and its first mover's advantage keeps rivals like Amazon.com (AMZN -1.64%) and UberEats at bay.

Cowen & Company recently estimated that Grubhub controls 34% of the online delivery market, compared to 20% on UberEats and 11% on Amazon. Eat24 has a 16% market share, so Grubhub will control about half of the entire market after that acquisition closes.

UberEATS' mobile app.

Image source: Google Play.

UberEats initially launched in 2014, and Amazon launched its food delivery service in 2015. Even with these two big competitors on the market, Grubhub posted more than 30% annual sales growth over the past five quarters -- indicating that Uber and Amazon can't simply render Grubhub obsolete by adding food delivery to their ride-hailing and e-commerce ecosystems.

Grubhub also continues to evolve with acquisitions, restaurant partnerships, and the integration into point-of-sale systems across the industry. If Grubhub plays its cards right, it could become the "Expedia of food delivery" -- rebuffing Amazon's expansion into the market in the same way Expedia crushed Amazon's online travel agency ambitions.

The bear case against Grubhub

However, Grubhub investors should realize that Amazon and Uber can afford to take big losses on its food delivery platform if it tethers more users to their ecosystems. That's a luxury that Grubhub doesn't have. Grubhub's total expenses surged 39% and accounted for 85% of its revenue during the first half of 2017, up from 83% of its revenue in the first half of 2016.

If Grubhub needs to aggressively counter promotional blitzes like free food deliveries for Prime members or frequent Uber customers, its expenses could gobble up more of its revenues. Grubhub also needs to counter rival marketing campaigns, which could be challenging since its sales and marketing expenses already jumped 30% annually last quarter.

Amazon also recently secured a partnership with Grubhub's smaller Olo, which serves over 200 restaurants brands including Shake Shack and Chipotle. The combination of Olo, Prime, and the Echo platform could dent Grubhub's market share if it doesn't shore up its defenses.

Lastly, Grubhub's valuations look lofty. The stock trades at 75 times earnings, more than double the industry average P/E of 36 for internet information providers. Its forward P/E of 37 looks cheaper, but it's still higher than its projected earnings growth rate for the year.

So will Grubhub sink or swim?

I personally like Grubhub's business model, and its resilient growth in the face of tough competition from Uber and Amazon indicates that it's here to stay. However, I'm concerned that food delivery services can be loss-leading side bets for Uber and Amazon, and Grubhub's bottom-line growth could suffer when push comes to shove.

I certainly regret missing Grubhub's year-long rally, but I think that its uncertain earnings growth and high valuation make it a risky buy with the market at all-time highs. I'll consider buying Grubhub on a big dip, but I'm not ready to start a new position at current prices.