Ecosystem efficiency and resilience