Dynamic FPS automatically reduces the speed at which minecraft renders when it's not focused (to 1 FPS) or hidden (no renders at all). It also fixes a bug in Vanilla Minecraft that makes it take much more performance in the background than it should.
Download in the releases section, on Modrinth, or on GitHub.
juliand665 (Fabric version)
A big thanks to him and his contributors for their work to offer a functional and updated mod for each new release of Minecraft!
N4TH4NOT (Forge version) 
It is me who has ported the original mod to Forge and who is keeping this repository updated.
If you have any ideas for improving this mod, I am open to any suggestion!
Contact: Email - Discord - Telegram
More projects : GitHub (coming later)
Please, report your issues on GitHub page or via MP otherwise I will delete you comment.