Kroger (KR -0.43%) shares have been trouncing the market lately, making the supermarket chain a standout performer in the retailing world. Investors are optimistic that the company can keep winning market share in today's inflationary environment, and that customer traffic will hold up even as spending shifts toward more consumer staples.

That bullish outlook will be tested when Kroger releases its fiscal first-quarter report in a few days. Let's take a look at how those results (due out on Thursday) might stack up against expectations -- and against its key rival, Walmart (WMT 0.57%).

Sales trends

A big factor driving Kroger's shares higher in the past year has been its shrinking growth gap with Walmart. After losing ground to the retailing titan through most of the pandemic, the chain pulled even last quarter, mainly on the strength of its produce and prepared food segments.

"Our strategy of leading with fresh," CEO Rodney McMullen said in early March, "propelled Kroger to record performance in 2021."

Thursday's announcement will show whether that strategy is still working. Investors will be judging Kroger's sales trends against Walmart, which said in mid-May that comparable-store sales were up 3% in Q1 and had increased 9% on a two-year basis.

Kroger's results might match or exceed that level if the chain can extend its positive market share momentum into fiscal 2022.

The inflation update

The main worry heading into Thursday's report is that Kroger will be tripped up by the same cost pressures that sparked a sell-off in Walmart's stock.

The retailer lowered its earnings outlook after profits were hurt by soaring labor and transportation expense pressures. Walmart now sees operating income declining 1% this fiscal year rather than rising 3% as management had originally forecast.

WMT Operating Margin (TTM) Chart

WMT Operating Margin (TTM) data by YCharts.

Kroger might avoid some of those pressures in 2022. The chain is vertically integrated, meaning it owns much of its supply chain. That setup means it can be more flexible around cost spikes for core products like milk. Profit margin rose last quarter, in fact, and investors are hoping to see similarly strong results for Q1.

New outlook

The stock's outperformance in 2022 reflects investors' expectations that Kroger will affirm its positive earnings outlook for the year, which currently calls for rising earnings and improving operating cash flow. Heading into Thursday's announcement, Kroger's 2022 forecast also predicts that comps will rise by between 2% and 3% after jumping 14% in the past two years.

In Walmart's latest report, the retail giant boosted its growth outlook slightly, but disappointed investors by lowering its earnings target. Kroger's stock-price rally might depend on its ability to continue outpacing those metrics so that the company stays near the top of the consumer staples industry.

A bullish forecast for 2022 earnings would soothe investors who are worried about a growth slowdown or recession. Kroger might even stand to gain market share in today's selling environment, which has consumers increasingly looking for deals on their groceries even as they continue splurging in some areas.