Volatile commodity prices amid growing supply, poor financial performance and disfavor from some investor groups all contributed to the energy sector's transformation from investor darling to investor outcast.

U.S. crude prices fell more than 20% during the 2010s, while the rise of alternative energy also brought pressure, with some stock buyers shunning fossil fuel investments.

But with the dawn of a new decade, some investors say the sun is also rising on energy shares.

The energy sector's swoon defied a boom in U.S. domestic oil production, sparked by the advent of hydraulic fracturing. Ten years ago, the United States was a net importer of about 10 million barrels per day (MMbbl/d) of oil and fuels. It ends the decade poised to become a net exporter of oil and fuel products.

"It really is a great irony that at a time when the United States became the world’s biggest producer and has become a great exporter, that investors have become skeptical and have adopted a position of ‘show me the money,’” said Daniel Yergin, vice chairman of IHS Markit.

“Industry is having to demonstrate that it can deliver those returns over several quarters, not just one quarter, so they’re going through a real testing period right now," Yergin said.

The S&P 500 energy sector registered a meager 6% gain this decade, compared with a more than 180% rise for the benchmark S&P 500 stock index, according to Refinitiv data.

Including dividends, the energy sector's total return rises to roughly 39%. But that pales in comparison to the S&P 500's over 250% total return and is only slightly above the roughly 37% return of the ICE BofA Merrill Lynch Treasury index , a barometer of U.S. Treasury bond performance.

Over the past decade, including estimates for 2019, the energy sector’s total earnings have declined 14.8%, while all other major sectors have seen growth of at least 28%, according to Refinitiv data.

The energy sector's poor performance means its importance to the stock market has withered away.

Energy represents less than 5% of the weight of the overall S&P 500, down from over 15% in mid 2008, when U.S. crude prices topped $140 a barrel, according to Refinitiv data.

As a result, investors seeking overall stock market exposure require a smaller allocation of energy shares, another pressure point for the group.

Even so, the decade was transformational for the oil-and-gas industry, which flocked to booming fields in west Texas and North Dakota.

U.S. crude oil production, which was just over 5 MMbbl/d at the decade's outset, surged to a record 13 MMbbl/d by the decade's end, leading to an abundance of supply that has pressured prices, while natural gas output also is setting records.

"The price of energy has been lower than it would have been had none of this occurred," said Pearce Hammond, managing director at Simmons Energy in Houston.

"It never benefited the energy companies," he added. "Why? Because they outspent cash flow and they didn’t deliver any kind of real returns. They were just huge sinks of capital."

But as 2020 arrives, some investors believe the energy sector will leave its struggles behind.

“We have seen crude go to $60 and yet the energy stocks trade as if oil is at $40,” said Gary Bradshaw, portfolio manager of Hodges Capital Management in Dallas.

Investment advisory firm Alan B. Lancz & Associates is among those betting on energy shares. It is overweight the energy sector after buying shares of companies that include Exxon Mobil Corp., Chevron Corp. and Marathon Petroleum Corp., the firm's president, Alan Lancz, said.

A "perfect storm" of macroeconomic factors pressured commodity prices - including the strong U.S. dollar and slowing economies in emerging markets - as well as more recently a fear of eventual increased U.S. regulations that has sparked more drilling, Lancz said. But he thinks both macro and political factors are poised to ease over the next year.

“We see over a two-, three-year period a gradual recovery in this whole sector that has been unduly depressed,” Lancz said.