MW-Subsystem refactoring (Task #107)

Everything about development and the OpenMW source code.
User avatar
Zini
Posts: 5538
Joined: 06 Aug 2011, 15:16

MW-Subsystem refactoring (Task #107)

Post by Zini »

Since it will take some time for the formulae research to finish up (this should have been done a year ago, *sigh*), I am going to work on the MW-subsystem refactoring task, which should provide improved compilation speed as a side effect.

For reference, I did a complete rebuild with the current master branch. 4 minutes and 54 seconds on my box. let's see how far we can get that down.

This task will result in large scale code changes and many parts of the code base will end up in different places. I'll try remembering to post the most important changes here.
User avatar
Zini
Posts: 5538
Joined: 06 Aug 2011, 15:16

Re: MW-Subsystem refactoring (Task #107)

Post by Zini »

I moved CellStore from ESMS to MWWorld. Also, once this has been integrated into master, please use MWWorld::CellStore instead of MWWorld::Ptr::CellStore.

Preparations for the actual task mostly complete now.
User avatar
Zini
Posts: 5538
Joined: 06 Aug 2011, 15:16

Re: MW-Subsystem refactoring (Task #107)

Post by Zini »

First part done. World has been moved to MWBase.

Build time is down to 4 minutes and 14 seconds; roughly 15% faster. Most partial builds should look even better.

An important note: Please be more careful with your includes. I found quite a lot that are completely unneeded and they are at least partially responsible for the slow compiling.
User avatar
Zini
Posts: 5538
Joined: 06 Aug 2011, 15:16

Re: MW-Subsystem refactoring (Task #107)

Post by Zini »

#include <Ogre.h> ? Really? I think I will go berserk for a bit. Will take me hours to clean up that mess.
User avatar
Zini
Posts: 5538
Joined: 06 Aug 2011, 15:16

Re: MW-Subsystem refactoring (Task #107)

Post by Zini »

After cleaning out the Ogre.h crap and some other includes, we are down to 2 minutes and 42 seconds. Build time reduced by approximately 45%.
Myckel
Posts: 72
Joined: 16 Jun 2012, 09:48

Re: MW-Subsystem refactoring (Task #107)

Post by Myckel »

Sweet! Does this also have an influence on the runtime speed?
User avatar
Zini
Posts: 5538
Joined: 06 Aug 2011, 15:16

Re: MW-Subsystem refactoring (Task #107)

Post by Zini »

Nope. Building only.


btw. I decided to merge what i have into master now. This task is very tiring, so I am taking a break from it and continue with the potion/ingredients usage task.

Once the merge is complete (in a few minutes), everyone with active branches is advised to merge in my master branch. There have been quite a few changes and you probably don't want to write new code that does not work with the modified code base.
User avatar
sirherrbatka
Posts: 2159
Joined: 07 Aug 2011, 17:21

Re: MW-Subsystem refactoring (Task #107)

Post by sirherrbatka »

Excellent! I will be glad to post about it. Cutting time needed to build openmw by almost half is a great thing.
Tarius
Posts: 574
Joined: 24 Oct 2011, 19:29

Re: MW-Subsystem refactoring (Task #107)

Post by Tarius »

Zini seems rather patient around the forum. I dont think I would want to be around him when hes angry.
mikazo
Posts: 14
Joined: 05 Jul 2012, 04:31

Re: MW-Subsystem refactoring (Task #107)

Post by mikazo »

Just out of curiosity, does the code re-factoring involve splitting the code base into different Visual Studio projects? I know that separate projects and/or splitting code into separate dlls would allow faster build times because Visual Studio can take advantage of building several projects in parallel. I could be wrong, but I believe the rule of thumb is to set the number of parallel builds to (2 * number of processors - 2) under Tools > Options > Projects and Solutions > Build and Run > maximum number of parallel project builds. For example, I have 8 processors and set mine to 14 parallel builds.
Post Reply