It was Amazon that made the biggest retail grocery splash of the summer with the news it was purchasing Whole Foods Market.

But according to an analysis by forbes.com contributor Panos Mourdoukoutas, Amazon’s brick-and-mortar competitor Walmart has gotten the best of it lately — at least in the stock market.

In the three months ending Aug. 10, Walmart’s shares have risen 6.6 percent, compared to 2.2 percent for Amazon. Walmart also beats Amazon over the past six months, 19.7 percent to 15.7 percent.

That’s a big change from just a few months ago, Mourdoukoutas points out. In the 12 months ending May 3, Amazon gained 76.7 percent on Wall-Street, compared to 12.7 percent for Walmart.   

Higher grocery prices and investors’ confidence that Walmart can compete against Amazon have helped drive Walmart’s strong stock performance, says John Zolidis, president of Quo Vadis Capital Inc., whom Mourdoukoutas quotes in his column.