These are challenging times in the auto-parts industry, and no one's faring especially well. Since Advance Auto Parts (NYSE:AAP) is among the sector's worst performers, that outlook might be cold comfort for its shareholders. While its long-term picture still looks pretty good, Advance investors will need to exercise some patience in the face of a tough operating environment.

Advance warned us that this second quarter would be weak, and management was certainly right about that. Sales were up more than 8%, but comps were up just barely more than 1%. Within that number, do-it-yourself (DIY) comps were down about 1%, while commercial comps were up a healthy 9.1%. The operating margin, though, was not as solid -- whether you want to credit back the cost of stock compensation or not, margins fell, and it looks like operating costs will be a headwind for now.

Why are Advance, AutoZone (NYSE:AZO), Pep Boys (NYSE:PBY), and so on having a tough time? It sure doesn't seem like General Motors (NYSE:GM) and Ford (NYSE:F) have been so wildly successful selling new cars that they're taking older cars off the road. Instead, I suspect that higher interest rates (and perhaps higher fuel prices) are gradually eating at customers' available cash -- through higher rates on credit card balances, for instance.

Sooner or later, this too shall pass. Advance is the second-largest auto parts retailer in the country, and it didn't get there by accident. If there is an industry shakeout, I'd bet on Advance surviving. Moreover, if tougher economic times are leading to lower parts sales, I can't imagine that those same customers are out buying new cars. The odds would seem to favor the notion that the company's market is not going away.

Although I do think Advance Auto will be OK in time, I'm not sure I'd choose this stock ahead of AutoZone at present. The latter does more with its capital, and according to my valuation model, the two trade at roughly similar valuations. Do your own due diligence, of course, but be prepared to buckle up for what could be a bumpy ride for at least a few more quarters.

For more Foolish parts and accessories:

AutoZone is a Motley Fool Inside Value recommendation. Find more great companies trading at bargain-basement prices with a free 30-day trial subscription.

Fool contributor Stephen Simpson has no financial interest in any stocks mentioned (that means he's neither long nor short the shares).