Compile speed of various CMAKE_BUILD_TYPEs

Everything about development and the OpenMW source code.
Post Reply
User avatar
scrawl
Posts: 2152
Joined: 18 Feb 2012, 11:51

Compile speed of various CMAKE_BUILD_TYPEs

Post by scrawl »

I just did a rebuild with debug flags and noticed something odd. The build completed in 2 minutes, when it would normally take 3 minutes.

As it turns out, CMAKE_BUILD_TYPE has a huge impact on compile speed:
RelWithDebInfo

Elapsed time: 03:09.

Release

Elapsed time: 02:21.

None

Elapsed time: 01:43.

Debug

Elapsed time: 01:58.


g++ --version
g++ (Ubuntu 4.8.4-2ubuntu1~14.04.1) 4.8.4
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Note how RelWithDebInfo (the default) is the slowest of the bunch, by far.

I propose that travis-ci and Coverity CI should run with -DCMAKE_BUILD_TYPE=None so that CI completes faster. The same might apply to Appveyor (AceSWE, can you comment on that?).
User avatar
Ace (SWE)
Posts: 887
Joined: 15 Aug 2011, 14:56

Re: Compile speed of various CMAKE_BUILD_TYPEs

Post by Ace (SWE) »

The AppVeyor builds already run as Debug, the fastest Windows build type.

Because of how Visual Studio solutions work, you don't use the CMAKE_BUILD_TYPE flag on Windows, instead CMake generates all possible build types and you choose which one you want at compile time.

As the appveyor.yml states;

Code: Select all

configuration: Debug

...

build_script:
...
  - cmd: msbuild %build%\OpenMW.sln /t:Build /p:Configuration=%configuration% ...
User avatar
cc9cii
Posts: 523
Joined: 28 Mar 2013, 04:01

Re: Compile speed of various CMAKE_BUILD_TYPEs

Post by cc9cii »

This isn't my experience (I must be doing something different, but I simply followed the wiki like everyone else?)

Debug is unusable for me, both from compile time and running (takes so much longer to execute, it is useless as a dev build).

EDIT: by the way, 3 minute build time - is that real or typo? Modifying a template header can take well over an hour for me (but then I'm still on a core2duo laptop)
User avatar
Ace (SWE)
Posts: 887
Joined: 15 Aug 2011, 14:56

Re: Compile speed of various CMAKE_BUILD_TYPEs

Post by Ace (SWE) »

In all my local testing, Debug has always been the one with the fastest builds. But my machine is a bit of a beast when it comes to compiling so I guess it might not be the best - average - test case.
So I created a PR for building OpenMW with the different build types to see which one AppVeyor likes the most, just to be empiric about it.
Chris
Posts: 1626
Joined: 04 Sep 2011, 08:33

Re: Compile speed of various CMAKE_BUILD_TYPEs

Post by Chris »

I'm surprised about RelWithDebInfo taking longer than Release, since the former actually has slightly weaker optimizations than the latter, and just also adds some debug info. It makes sense for them both to take longer than Debug or None, though, since optimizations take up quite a bit of time.

It may also be worth comparing with Clang, since it's supposed to be a bit faster than GCC (in compile times, not necessarily generated code).
User avatar
Ace (SWE)
Posts: 887
Joined: 15 Aug 2011, 14:56

Re: Compile speed of various CMAKE_BUILD_TYPEs

Post by Ace (SWE) »

I've now run through the four different build types on AppVeyor, and the results are that only Debug is able to finish the build inside of the one hour time-limit AppVeyor gives us.
I call that a definitive result.

You Linux people have it good.
User avatar
Zini
Posts: 5538
Joined: 06 Aug 2011, 15:16

Re: Compile speed of various CMAKE_BUILD_TYPEs

Post by Zini »

Truer words have never been spoken.
User avatar
scrawl
Posts: 2152
Joined: 18 Feb 2012, 11:51

Re: Compile speed of various CMAKE_BUILD_TYPEs

Post by scrawl »

Huh, since when do our Appveyor builds complete in 14 minutes? Have they beefed up their build machines or what?

https://ci.appveyor.com/project/scrawl/ ... .0-c7f322a

That is an impressive change considering that we used to hit the 1-hour limit on some occasions.
Last edited by scrawl on 16 Jul 2016, 23:11, edited 1 time in total.
User avatar
Ace (SWE)
Posts: 887
Joined: 15 Aug 2011, 14:56

Re: Compile speed of various CMAKE_BUILD_TYPEs

Post by Ace (SWE) »

Oh wow, that's quite an impressive speedup indeed. Perhaps this means we could try another attempt at building the entire OpenMW suite, and not just the engine itself.

Edit:

For more clarification;
Dear customers,

We have great news! Today we moved all open-source and most private accounts to a new build environment hosted at RackSpace.

For open-source projects that means their builds will start and run faster and private projects may notice better performance as well.

Virtual machines in the new environment have 2 CPU cores and up to 4 GB of RAM. The new public IP address for that environment is 74.205.54.20 - you may need to update your firewalls.

We are still going to maintain Google Compute Engine (GCE) environment for selected accounts and as a backup build cloud. If your private builds were previously running on GCE they will remain there.

Some open-source projects may experience issues while building on a new environment. Due to implementation differences between GCE and Hyper-V platforms we have separate build worker images for GCE and Hyper-V environments, so there might be minor discrepancies in installed software. Please report any issues you notice - your help with fixing those issues is much appreciated.

We have a good reason for this move as some customers already reported 10x performance increase!

We would love to hear your feedback!

Best regards,
AppVeyor team
Post Reply