IT HAS been a grim decade for investors in international oil firms—among them, many of the world’s biggest pension funds. Even before oil prices started to fall in 2014, the supermajors threw money away on grandiose schemes: drilling in the Arctic and building giant gas terminals. Their returns have trailed those of other industry-leading firms by a huge margin since 2009.

In the past 18 months things have gone from bad to worse. The Boston Consulting Group, a consultancy, calls it the industry’s “worst peacetime crisis”. That is evident in first-quarter results released in the past week by Exxon Mobil and Chevron of America, and European rivals, Royal Dutch Shell, BP and Total, which bear the scars of a collapse in oil prices to below $30 a barrel in mid-February (see chart).

Since then the oil price has rebounded to $45 a barrel; as a result of aggressive cost-cutting efforts, their earnings have mostly been better than expected. Miraculously, a bit of cheer has returned. The big firms’ share prices have outperformed America’s S&P 500 index by nine percentage points since the start of the year.

It is too soon to declare victory, though. Not only do the supermajors need to brace for the possibility of a renewed slide in oil prices in the short term; they must also prepare for a future in which oil demand is increasingly uncertain because of climate change, pollution and the emergence of alternative sources of energy. Sanford C. Bernstein, a research firm, argues that such “peak demand” is not imminent. There may be at least another 15-year growth cycle by oil firms before investors throw in the towel. But in the meantime companies need to develop a new business model built around a quest for returns rather than for reserves.

These returns are still woefully low, and debts unusually high. On May 4th Shell issued its first earnings report since acquiring BG, a smaller British rival, for $54 billion in February. Thanks mostly to decent sales and marketing performance, analysts considered it a fair outcome. But its returns on average capital employed, an industry benchmark, were a miserly 3.8%—well below its cost of capital. It also had net debt of $69 billion, a burden that should keep its executives awake at night if oil prices fall again. A few days earlier, Exxon Mobil reported its smallest quarterly profit since 1999, shortly after Standard & Poor’s, a rating agency, had cut the triple-A rating that it had enjoyed for decades. (That left America with only two blue-chip firms, Johnson & Johnson and Microsoft.)

Optimists, however, are starting to look beyond these shortcomings, for several reasons. First, cost discipline is becoming an industry-wide mantra. Shell, for instance, says it hopes to slash $30 billion from combined operating costs and capital spending by the end of this year, compared with 2014, despite the effort involved in swallowing BG.

Second, investment projects are being looked at more realistically than they were when it was blithely assumed that oil prices would remain above $100 a barrel for the foreseeable future. Third, the supermajors are less likely to embark on wasteful mega-mergers, as they did in the 1990s. The Shell/BG deal went ahead despite loud opposition from some shareholders. Elsewhere, competition authorities are baring their teeth. On May 2nd Halliburton, the world’s second-largest oil-service company, scrapped its $28 billion merger with Baker Hughes, the third-largest, after the Department of Justice opposed it on antitrust grounds.