Page 1 of 2

MW-Subsystem refactoring (Task #107)

Posted: 29 Jun 2012, 14:28
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.

Re: MW-Subsystem refactoring (Task #107)

Posted: 29 Jun 2012, 18:04
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.

Re: MW-Subsystem refactoring (Task #107)

Posted: 03 Jul 2012, 11:35
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.

Re: MW-Subsystem refactoring (Task #107)

Posted: 03 Jul 2012, 13:14
by Zini
#include <Ogre.h> ? Really? I think I will go berserk for a bit. Will take me hours to clean up that mess.

Re: MW-Subsystem refactoring (Task #107)

Posted: 03 Jul 2012, 14:38
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%.

Re: MW-Subsystem refactoring (Task #107)

Posted: 03 Jul 2012, 14:39
by Myckel
Sweet! Does this also have an influence on the runtime speed?

Re: MW-Subsystem refactoring (Task #107)

Posted: 03 Jul 2012, 14:53
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.

Re: MW-Subsystem refactoring (Task #107)

Posted: 03 Jul 2012, 14:55
by sirherrbatka
Excellent! I will be glad to post about it. Cutting time needed to build openmw by almost half is a great thing.

Re: MW-Subsystem refactoring (Task #107)

Posted: 05 Jul 2012, 04:46
by Tarius
Zini seems rather patient around the forum. I dont think I would want to be around him when hes angry.

Re: MW-Subsystem refactoring (Task #107)

Posted: 09 Jul 2012, 03:30
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.