The idea work and actual work of the system is called irreversibility. It is often referred to as degradation or dissipation. Efficiency according to the second law or exergy efficiency as the name suggests computes
Irreversibility: What is? (Thermodynamics)