Dynamic FPS automatically reduces the speed at which minecraft renders when it's not focused (to 1 FPS, configurable) or hidden (no renders at all, configurable). It also fixes a bug in Vanilla Minecraft that makes it take much more performance in the background than it should, as well as making the game not render while reloading resources (which makes it take forever on my machine!).
There is an in-game config screen. To access it, install Mod Menu and find Dynamic FPS in the mod list, then click the gear button.