(Bloomberg) — Oil production in some of the riskiest, highest-cost regions of North America is still thriving, even as the worst slump in a generation takes a bite out of U.S. shale.

Onshore U.S. output is poised to drop 22% from last year through 2017, according to the Energy Information Administration. However, new volumes coming on stream from developments envisioned years ago in Canada’s oil sands and the U.S. Gulf of Mexico are limiting North America’s total production decline.

Exxon Mobil Corp. is among companies bringing platforms online in the U.S. Gulf of Mexico from discoveries made in the past decade, which will help boost offshore output by 18% from last year to a record high in 2017, the EIA forecast this month. In the oil sands, developers including Canadian Natural Resources Ltd. are also expanding projects, leading to a 16% increase over the same period, Canadian Association of Petroleum Producers data show.

North American oil and liquids output is set to fall 2.6% to 21.6 million barrels a day by 2017, as production in Mexico and the U.S. declines and Canadian output rises, according to the EIA.

Exxon has started production from its Julia deepwater project, the company said this week. The field may produce as much as 34,000 barrels a day.

Oil and gas explorers have sidelined 78% of the onshore U.S. drilling rigs since a November 2014 record, Baker Hughes Inc. data show. That includes 76% of the horizontal rigs, which helped accelerate the historic rise in the nation’s oil production.

Horizontal rigs may never rise that high again, thanks to efficiency gains that have reduced the time it takes to drill each well. Each rig will drill 15.1 wells this year, up from 13.2 in 2014, according to a forecast from Bloomberg Intelligence. Rising initial production rates from each well also mean fewer wells are needed to tap the same level of production, according to analysts Andrew Cosgrove and Will Foiles.

To be sure, megaprojects aren’t poised to add the same production gains later this decade once projects in the works are complete. There is no new oil-sands production set to start up in 2018, ending almost two decades of expansion after about 500,000 barrels a day of planned investments were sidelined by the price slump, according to the Oil Sands Review’s Spring Oil Sands Quarterly.