Until we're headed into a recession, don't go piling into consumer staples. 

In a note to clients on Thursday, Jonathan Glionna and the equity strategy team at Barclays looked at the performance of the consumer staples sector, which includes companies like Coca-Cola, Campbell Soup, and Proctor & Gamble. The idea is that these companies make things people are going to buy no matter what. 

And so what Glionna and his team found is that this sector outperforms when the US heads into recession, but outperforms as the economy sputters. Glionna and his team found that the sector, which comprises about 10% of the market, has beaten the S&P 500 by 49% in the last 25 years, though most of this outperformance was created during 3 periods: 1990-93, 200-03, and 2008-09. 

"Not coincidentally," Barclays wrote, "these are periods when the U.S. economy experienced a recession and the S&P 500 declined. Overall, the staples sector captures most of its relative return when the market is falling, confirming the sector's reputation for being defensive." 

On Friday, we got another sign that the US economy isn't doing so well, as consumer confidence declined to reflect fading optimism that the much-talked-about economic rebound in the second quarter of this year won't actually materialize. 

Glionna and his team, however, wrote that with no sign of recession on the horizon, going overweight the consumer staples sector isn't likely to be successful. But when a recession does appear, feel free pile in. 

NOW WATCH: 70 people were injured while filming this movie with 100 untamed lions

See Also:

What earnings growth would've looked like if oil didn't crash and the dollar didn't surgeThe decline in S&P 500 leverage is unprecedentedBirth rates and unemployment rates are closely related