Godot version:
master a1fcac640061c45e9dc55b1189e82aed3e2672fb
OS/device including version:
Manjaro Linux x64, Radeon R7 360 (mesa version 19.1.5-1)
Issue description:
Upon upgrading from 3.1.1 to the latest master I encountered a 3d performance regression of about ~35%. My personal game when from ~70 fps to ~40 fps and the attached reproduction project I built goes from ~77 fps in 3.1.1 to ~50 fps in the latest master on my hardware.
Reproduction project
PerfRegression.zip
When you built it yourself, did you do so with build flag target=release_debug or target=debug or no target (which implies debug).
Oftentimes users are surprised when building themselves because debug builds are slower than release builds.
Official binaries (editor and export templates) are also compiled with link-time optimization, so you'll want to pass use_lto=yes to the SCons command line for release builds.
Compiling with target=release_debug and use_lto=yes had no effect (if anything it made it worse but it is within margin of error)
Here is the full command I'm using to build so you can check my work
scons p=x11 tools=yes module_mono_enabled=yes mono_glue=yes target=release_debug use_lto=yes -j 4
(This is a mono enabled build but this perf issue affects both my game which is entirely C# and the reproduction project which is entirely GDScript)
According to the CLI help optimize=speed is default (I checked before opening the issue)
I also want to mention that this seems to affect both GLES3 and GLES2
I can't reproduce. On my laptop (Ubuntu 16.04) I get 17 fps on 3.1.1 and master with release_debug and 14 fps on master with debug
Nor me to such an extent. With the reproduction project:
I got 72fps with Godot 3.1.1, 53fps with (near) current master and debug build, and 68-70fps with release build and LTO. That's not to say that there hasn't been some particular change that is affecting the OP's particular hardware.
@ForLoveOfCats Please compare building the 3.1 branch with building the master branch, instead of comparing a pre-built release 3.1.1 binary with master.
Can you also compare performance in a project such as the Sponza demo? I get more FPS in the master branch compared to 3.1.1 here (94 FPS vs 86 FPS on the High preset).
I wasn't able to build 3.1.1 before opening this issue as it doesn't like the Mono version my system has. Later today (I'm out for most of the day, apologies) I will prepare a GDScript only build of both 3.1.1 and master in order to compare.
After building a clean copy of 3.1.1 and latest master (no Mono) the reproduction project gets ~80-85 fps whereas master gets ~74-76 fps (with release debug and lto for both builds). So I'm still experiencing a perf drop but not as great as I've seen before so I tried building latest master (updated from the commit that was latest at the start of all this) with Mono which is currently having some issues. I'm going to troubleshoot the Mono enabled build some more before testing it but I wanted to document what results I have so far.
I feel stupid now, when set to release debug and with LTO enabled it emits a differently named binary which is why I encountered the same perf issue even after recompiling with these two flags. So there is still that slight perf drop (within margin of error?) but not the level I was seeing. Should this issue be closed or should this very slight perf drop of 1%-2% be investigated further? (I'm leaning toward just closing) Either way my apologies for accidentally making this seem like a much much larger issue than it is (or isn't?).
A tip for the future: When investigating strange issues, git clean -fXd is quite useful. Also, my Godot build scripts remove bin/* before each build. (Mono version)
Noted, apologies again for accidentally blowing this out of proportion.
Most helpful comment
I feel stupid now, when set to release debug and with LTO enabled it emits a differently named binary which is why I encountered the same perf issue even after recompiling with these two flags. So there is still that slight perf drop (within margin of error?) but not the level I was seeing. Should this issue be closed or should this very slight perf drop of 1%-2% be investigated further? (I'm leaning toward just closing) Either way my apologies for accidentally making this seem like a much much larger issue than it is (or isn't?).