The investor stampede away from e-commerce stocks has brought valuations down across the industry. Part of that decline makes sense given that sales growth is slowing and a recession could be on the way in 2023.

But smart investors can look past temporary challenges like those as they build portfolios that maximize long-term returns. With that goal in mind, let's look at two underperforming e-commerce specialists that have fallen out of favor on Wall Street.

Chewy (CHWY 4.37%) and Wayfair (W -8.16%) both have some attractive qualities, but one is the clear winner in this investing matchup.

Growth winner: Chewy

The dramatic demand shifts in the wake of the pandemic caught most e-commerce companies by surprise. Just when they had ramped up spending in expectation of booming sales through 2022, consumers tilted their priorities away from the categories they had previously favored.

But Wayfair has been hit much harder by this shift. Sales are down 13% through the first nine months of 2022, the company said in its latest earnings report, compared to a roughly 12% increase for Chewy. But Wayfair's trends are worse than they might seem by simply watching reported sales.

The home furnishings giant has lost a huge portion of its active customer base, which shrank by 23% in the third quarter. By contrast, Chewy has been steadily expanding its base of pet owners, even if that growth has slowed compared to 2021. The pet supply specialist easily wins in the growth matchup.

Financial winner: Chewy

Chewy is also in a much better place when it comes to finances. Wayfair's net losses have ballooned through 2022 as the company tried to get spending back in line with sales trends. Losses were $283 million last quarter and cash outflow was over $400 million.

CHWY Cash from Operations (TTM) Chart

CHWY Cash from Operations (TTM) data by YCharts

Chewy, on the other hand, is actually boosting core profitability right now thanks to the combination of rising prices and increased cost cutting. The e-tailer is not under a cash crunch, either, having generated positive cash flow through the first three quarters of 2022.

Valuation winner: Wayfair

Both stocks are much cheaper today compared to a year ago, but Wayfair easily wins this comparison. You have to pay 1.8 times annual sales to purchase Chewy right now, which is quite a bit less than the nearly 3 times sales investors were paying in early 2022. However, Wayfair's price-to-sales ratio has collapsed to about 0.3 from 1.5 a year ago.

The pessimism reflected in that valuation slump can often support solid returns for investors willing to hold through a tough short-term period. Wayfair's growth will likely return once shopping trends normalize in the home furnishings market, after all.

However, investors should still prefer Chewy stock today. Not only is the pet industry resistant to recessions, but Chewy seems especially well-positioned to ride out an economic storm given that roughly 80% of its sales come from staple products like pet food. The fact that it has maintained profitability through the current slowdown means shareholders are less likely to see surprising losses ahead, too.

Wayfair is worth watching and might be a compelling buy once its path back to profitability becomes clearer. But for now, investors should be sticking to proven e-commerce winners like Chewy to hold through 2023 and beyond.