how to fix mobile lagging while recording game play

when i played one of the best 3D action game Rope Hero i'm facing this issue i tried to fix it i performing the following steps and boom my mobile performance was so good. please follow these steps to bost your mobile performance.
To fix mobile lagging while recording gameplay, you can follow these steps:
1. **Close background apps**: Identify resource-hungry apps running in the background and close them to free up memory and reduce lag
2. **Optimize for gaming**: Use an app like AutoKiller Memory Optimizer to optimize your RAM for a better gaming experience.
3. **Remove unwanted apps and games**: Storing many apps and games on your smartphone can impact performance. Uninstall rarely used apps and games to free up memory and reduce lag
4. **Restart your device regularly**: Restarting your device can help clear the cache and improve performance.
5. **Use a cleaner app**: A cleaner app can help remove unnecessary files and free up storage space, which can reduce lag.
6. **Charge your phone before use**: Charging your phone before playing games can help improve performance.
7. **Limit background processes**: Restrict background usage in your device's settings to prevent unnecessary processes from running in the background.
8. **Clear cache regularly**: Clearing cache from your device can help reduce lag and improve performance.
9. **Update your device's software**: Keep your device's software up-to-date to ensure optimal performance and bug fixes.
Remember to back up your data before applying any changes to your device. If the lag persists, consider performing a factory reset or using a more powerful device for gaming