The 2017 Porsche Panamera was hardly designed to be a "green" car.

While it will likely continue to be offered with an optional plug-in hybrid powertrain, the large four-door luxury sedan prioritizes performance and luxury over outright efficiency.

But that doesn't mean Porsche has ignored fuel economy completely.

DON'T MISS: Confirmed: Porsche Mission E Electric Car Will Be Built By 'End Of Decade' (Dec 2015)

In fact, the German carmaker went to quite extraordinary lengths to maximize efficiency during the redesign that produced the latest generation of Panamera.

The complexity of this luxury sedan's fuel-saving elements show just how far some carmakers must now go to boost the efficiency of new models.

Let's start with the body.

2017 Porsche Panamera

2017 Porsche Panamera

Like many other carmakers, Porsche attempted to decrease its weight through using a mix of materials.

The 2017 Panamera body shell includes 31 percent aluminum and 31 percent Boron high-strength steel—saving a total of 144 pounds, according to Porsche.

To reduce aerodynamic drag at speed, it also has multiple active aerodynamic elements.

ALSO SEE: 2014 Porsche Panamera S E-Hybrid: Gas Mileage Review Of Plug-In Hybrid (Apr 2015)

Active grille shutters close when extra cooling air isn't needed, routing air around the front of the car rather than through the engine compartment.

When the shutters close, the movable rear spoiler moves into a special "Eco" position as well.

At 124 mph, the shutters automatically open again, and the spoiler switches to a presumably less-efficient "Max" setting to increase downforce at the rear of the car.

2017 Porsche Panamera

2017 Porsche Panamera

The Panamera gets two new engines for 2017, with a 4.0-liter twin-turbocharged V-8 that debuts in the Turbo model.

This engine features cylinder deactivation, which shuts down four cylinders under light loads, as well as a higher-pressure direct injection system to better control the fuel burn.

It produces 550 horsepower and 567 pound-feet of torque, allowing for 0 to 60 mph in 3.4 seconds, according to Porsche.

MORE: Now, finally, the Germans are getting scared of Tesla?

Base Panamera 4S models use a 2.9-liter V-6 that is essentially a V-8 with two of the cylinders lopped off.

This engine produces 440 hp and 405 lb-ft of torque, producing acceleration from 0 to 60 mph in 4.0 seconds.

All-wheel drive is standard on the 2017 Panamera, as is a new 8-speed dual-clutch transmission that replaces the previous conventional 8-speed automatic.

2017 Porsche Panamera

2017 Porsche Panamera

Porsche says it considered 9- and 10-speed transmissions, but concluded eight gears were sufficient, saying the new transmission improves fuel efficiency by 1.7 percent over the old one.

Its housing also has room for an electric motor, for the plug-in hybrid model that will replace the current Panamera S E-Hybrid.

Controlling all of the Panamera's various systems are 100 million lines of code, up from a mere 2 million in the previous generation, Porsche says.

RELATED: Porsche product manager trash-talks Tesla over Ludicrous mode performance

The number of electronic control modules has also increased from 70 to 112.

Yet even with all that code—and the grille shutters, and the cylinder deactivation, and all the other fuel-saving features—no Panamera without a plug will ever get close to the energy efficiency of an all-electric car.

While few Porsche owners likely prioritize fuel economy, Porsche itself has emphasized efficiency with this latest luxury sedan, and has delivered huge numbers of seemingly incremental improvements.

2017 Porsche Panamera

2017 Porsche Panamera

The Tesla Model S largely matches the Panamera on performance and features (and perhaps software complexity), but it is far more energy efficient on a wells-to-wheels basis  than anything the German luxury establishment now builds.

For one of very few times in recent memory, German luxury makers find themselves playing catch-up.

Porsche may regain the lost ground when its all-electric Mission E sedan launches before the end of the decade.

Until then, it can't claim any efficiency crowns—if that matters to its buyers.


Follow GreenCarReports on Facebook and Twitter