i have been playing around with the terrain paging in 1.9rc2 and unity build support finally works for me! (didn't in 1..
if you haven't used unity build, it's amazing:
http://buffered.io/posts/the-magic-of-unity-builds/
my project of size @30k lines across 175+ .cpp files used to compile full release in 15 minutes. with unity build it takes 45 seconds.
and if you want incremental builds, you can exclude individual .cpp files and still have 3 sec compiles for isolated changes.
compiling ogre used to take 25-35 minutes and now its under a minute or two.
unity build is amazing
- Kojack
- OGRE Moderator
- Posts: 7157
- Joined: Sun Jan 25, 2004 7:35 am
- Location: Brisbane, Australia
- x 534
Re: unity build is amazing
Yeah, it's pretty damn cool.
What I do is make sure I've got the files split up enough for multiple cores. If I'm on a quad core cpu, I use the ogre default of 50 files per cpp (setting in cmake for unity build). That results in 4 unity cpp files. But my main pc is a hex core, so I use a build setting of around 32, that gives 6 cpp files. That way there's one for each core.
Although I haven't timed the difference.
What I do is make sure I've got the files split up enough for multiple cores. If I'm on a quad core cpu, I use the ogre default of 50 files per cpp (setting in cmake for unity build). That results in 4 unity cpp files. But my main pc is a hex core, so I use a build setting of around 32, that gives 6 cpp files. That way there's one for each core.
Although I haven't timed the difference.
-
- Platinum Sponsor
- Posts: 290
- Joined: Tue Jan 17, 2012 5:18 am
- x 67
Re: unity build is amazing
hey, that's an excellent tip. i sped up my compile even further. thanks!
-
- Goblin
- Posts: 262
- Joined: Fri Nov 18, 2011 6:50 pm
- x 3
Re: unity build is amazing
Has anyone compared how compile-times are affected by switching a NON-unity build from HDD to SSD based system? It would in theory make a big difference since file-IO is mentioned in that article as being one of the issues addressed in unity builds? Linking on the other hand would probably not be?
Looking to find experienced Ogre & shader developers/artists. PM me with a contact email address if interested.
-
- Gremlin
- Posts: 193
- Joined: Sat Aug 06, 2011 11:02 pm
- x 6
Re: unity build is amazing
Huh, I had no idea you could do that. How does this work when compiling a lot of projects (we currently have 35)? Do you have to add a unity build file to every project?
- Klaim
- Old One
- Posts: 2565
- Joined: Sun Sep 11, 2005 1:04 am
- Location: Paris, France
- x 56
- Contact:
Re: unity build is amazing
Yes. The idea is that you generate cpp files which contain the content of several other cpp files. The less cpp files you can gather into one, the better.shenjoku wrote:Huh, I had no idea you could do that. How does this work when compiling a lot of projects (we currently have 35)? Do you have to add a unity build file to every project?
However, it also means that you can't use namespace/global variable names which are the same but in separate source cpp files. Most users will not do this anyway, but
advanced users who understand well the compilation+linking process can take advantage of it and make hard to have unity builds.
I wonder if it would be possible for an IDE, say Visual Studio, to generate such unity build by changing the name of potentially conflicting variables and just do all this automatically.
It would generate as many cpp as available threads/core/build-server for build and just run. Or maybe the generation of the cpp files would kill compilation performance anyway.
-
- Gremlin
- Posts: 193
- Joined: Sat Aug 06, 2011 11:02 pm
- x 6
Re: unity build is amazing
Wow this stuff is insane. Took me nearly all day to get it setup for just the Ogre related projects and our main project and it cut down the Release build time from 16:10.788 to 06:46.253. That's going to help quite a lot going forward.
The scary part about this is that the UnityBuild version of our app doesn't have a major rendering bug that I've been trying to figure out for a long time...
The scary part about this is that the UnityBuild version of our app doesn't have a major rendering bug that I've been trying to figure out for a long time...
- Kojack
- OGRE Moderator
- Posts: 7157
- Joined: Sun Jan 25, 2004 7:35 am
- Location: Brisbane, Australia
- x 534
Re: unity build is amazing
The only thing worse than a bug you can't solve is a bug that disappears on it's own. You just can't trust the code without knowing why it's gone (if it really is gone).
-
- Gremlin
- Posts: 193
- Joined: Sat Aug 06, 2011 11:02 pm
- x 6
Re: unity build is amazing
Yeah I know, it just confirms what I was worried about, which is that something in Ogre seems to be very broken and just happens to be working on accident. Doesn't make fixing it any easier though sadly. I don't want to hijack this thread though. I already have a thread up trying to figure out the issue over here: http://www.ogre3d.org/forums/viewtopic.php?f=5&t=79637Kojack wrote:The only thing worse than a bug you can't solve is a bug that disappears on it's own. You just can't trust the code without knowing why it's gone (if it really is gone).
@loath, Thanks for bringing unity build to my attention. Should be rather helpful cutting down those nasty build times
-
- Platinum Sponsor
- Posts: 290
- Joined: Tue Jan 17, 2012 5:18 am
- x 67
Re: unity build is amazing
simedj wrote:Has anyone compared how compile-times are affected by switching a NON-unity build from HDD to SSD based system? It would in theory make a big difference since file-IO is mentioned in that article as being one of the issues addressed in unity builds? Linking on the other hand would probably not be?
i'm using an SSD system (with raid) for max build time perf. all of my timings (15 minutes release compile down to 45 seconds) were on this machine and my laptop which experienced similar results.
glad this worked out well for you shenjoku!