Trackmania not enough ram

Ok so trackmania is runing now(using the 4gb swap, I found cscs guide online and used it without problems Manjaro Freezing BAD - #6 by cscs) from ubisoft connect its still is quite laggy but its playable at like 10-20 fps, after setting the settings to the lowest possible. I would like to learn more about how to optimize it. Im gonna try to install openplay and from it the plugin tweak to reduce render distance and increase fps.