Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiler performance, do we want to build the release with a specific compiler? #12

Open
illwieckz opened this issue Jul 19, 2021 · 1 comment
Labels

Comments

@illwieckz
Copy link
Member

illwieckz commented Jul 19, 2021

On the same hardware and operating system:

  • CPU: AMD FX 9590
    performance profile, 8 cores, 4.4GHz (a bit underclocked from stock 4.7GHz for stability), Piledriver architecture
  • RAM: 16 GB, 1600 MHz, DDR3
  • GPU: AMD R9 390X
    high performance profile, 44 compute units, 1050MHz, GCN2/Grenada XT architecture, PCIe 2.0
  • VRAM: 8GB, 1500 MHz, GDDR5
  • OS: Ubuntu 20.04.2 LTS “Focal Fossa” with Mesa radeonsi 21.0.3

I tested the /devmap plat23 ; delay 100f setviewpos 1893 1920 0 0 0 scene (a scene with many animated models) with 640×480 resolution and lowest preset to minimize GPU computation and r_vboVertexSkinning 0 to use the CPU code path to animate models and then stress test a lot the CPU.

I built the game with RelWithDebInfo build profile and ran the game with .nexe.

Here is the performance I get:

Compiler FPS Note
GCC 9.3.0 42 Ubuntu 20.04.2 default GCC
GCC 9.3.0 + LTO 46 Ubuntu 20.04.2 default GCC
GCC 10.3.0 10 Ubuntu 20.04.2 alternate GCC
GCC 10.3.0 + LTO 10 Ubuntu 20.04.2 alternate GCC
Clang 10.0.0 47 Ubuntu 20.04.2 default Clang
Clang 12.0.0 48 Ubuntu 20.04.2 alternate Clang
Clang 12.0.0 + LTO 49 Ubuntu 20.04.2 alternate Clang

Here are details for 20 second capture (1 line is the average FPS in a second) for those compilers, such line print is produced by setting LIBGL_SHOW_FPS=1 environment variable on Mesa:

GCC 9

libGL: FPS = 43.00
libGL: FPS = 42.00
libGL: FPS = 43.00
libGL: FPS = 42.00
libGL: FPS = 42.00
libGL: FPS = 42.29
libGL: FPS = 42.00
libGL: FPS = 42.29
libGL: FPS = 42.00
libGL: FPS = 42.29
libGL: FPS = 43.00
libGL: FPS = 42.29
libGL: FPS = 42.29
libGL: FPS = 43.00
libGL: FPS = 42.00
libGL: FPS = 42.00
libGL: FPS = 42.29
libGL: FPS = 43.00
libGL: FPS = 42.00
libGL: FPS = 42.00
libGL: FPS = 42.29

GCC 9 + LTO

libGL: FPS = 46.00
libGL: FPS = 46.00
libGL: FPS = 46.00
libGL: FPS = 46.00
libGL: FPS = 45.24
libGL: FPS = 46.23
libGL: FPS = 46.00
libGL: FPS = 45.00
libGL: FPS = 46.00
libGL: FPS = 45.24
libGL: FPS = 46.00
libGL: FPS = 45.00
libGL: FPS = 45.00
libGL: FPS = 46.00
libGL: FPS = 46.00
libGL: FPS = 45.24
libGL: FPS = 46.00
libGL: FPS = 45.24
libGL: FPS = 46.00
libGL: FPS = 46.00

GCC 10

libGL: FPS = 11.00
libGL: FPS = 10.82
libGL: FPS = 11.00
libGL: FPS = 11.00
libGL: FPS = 11.00
libGL: FPS = 10.82
libGL: FPS = 11.00
libGL: FPS = 10.82
libGL: FPS = 11.00
libGL: FPS = 10.82
libGL: FPS = 10.64
libGL: FPS = 11.00
libGL: FPS = 10.82
libGL: FPS = 11.00
libGL: FPS = 10.82
libGL: FPS = 10.82
libGL: FPS = 10.64
libGL: FPS = 10.82
libGL: FPS = 11.00
libGL: FPS = 10.64

GCC 10 + LTO

libGL: FPS = 11.00
libGL: FPS = 10.82
libGL: FPS = 10.48
libGL: FPS = 10.82
libGL: FPS = 11.00
libGL: FPS = 10.82
libGL: FPS = 10.82
libGL: FPS = 10.64
libGL: FPS = 10.82
libGL: FPS = 10.64
libGL: FPS = 10.82
libGL: FPS = 10.82
libGL: FPS = 10.82
libGL: FPS = 10.82
libGL: FPS = 10.82
libGL: FPS = 10.82
libGL: FPS = 10.64
libGL: FPS = 10.82
libGL: FPS = 10.82
libGL: FPS = 10.82

Clang 10

libGL: FPS = 47.00
libGL: FPS = 47.00
libGL: FPS = 47.21
libGL: FPS = 47.00
libGL: FPS = 47.00
libGL: FPS = 47.00
libGL: FPS = 47.00
libGL: FPS = 47.00
libGL: FPS = 47.00
libGL: FPS = 47.00
libGL: FPS = 46.00
libGL: FPS = 47.00
libGL: FPS = 46.23
libGL: FPS = 46.23
libGL: FPS = 47.00
libGL: FPS = 46.23
libGL: FPS = 47.00
libGL: FPS = 47.00
libGL: FPS = 46.23
libGL: FPS = 47.00

Clang 12

libGL: FPS = 48.00
libGL: FPS = 49.00
libGL: FPS = 48.19
libGL: FPS = 48.19
libGL: FPS = 48.19
libGL: FPS = 48.19
libGL: FPS = 48.19
libGL: FPS = 48.19
libGL: FPS = 48.00
libGL: FPS = 48.00
libGL: FPS = 48.00
libGL: FPS = 48.00
libGL: FPS = 47.00
libGL: FPS = 48.00
libGL: FPS = 47.21
libGL: FPS = 48.00
libGL: FPS = 48.00
libGL: FPS = 48.00
libGL: FPS = 48.00
libGL: FPS = 47.21

Clang 12 + LTO

libGL: FPS = 49.00
libGL: FPS = 49.00
libGL: FPS = 48.19
libGL: FPS = 49.00
libGL: FPS = 49.00
libGL: FPS = 49.00
libGL: FPS = 48.00
libGL: FPS = 49.00
libGL: FPS = 49.00
libGL: FPS = 49.00
libGL: FPS = 48.19
libGL: FPS = 49.00
libGL: FPS = 49.00
libGL: FPS = 49.00
libGL: FPS = 48.00
libGL: FPS = 49.00
libGL: FPS = 49.00
libGL: FPS = 48.00
libGL: FPS = 49.18
libGL: FPS = 49.00
@illwieckz
Copy link
Member Author

I updated times with some LTO builds.

With GCC 9, LTO is a big win, it jumps from 42 fps to 46 fps.

With Clang 12, LTO adds one more FPS, it jumps from solid 48 fps to 49 fps.

Note: for Clang 12, the LTO build was done with lld12, the non-LTO Clang 12 build performs the same with ld and lld12.

I was not able to produce LTO builds with Clang 10, and LTO builds with GCC 10 just adds nothing. I don't know what happens with GCC 10.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant