Compile takes too long in Visual Studio 2013

while compiling my cocos2d project for win32 using Visual Studio 2013

my computer

Is this normal?

maybe you coded and infinite loop by accident?
and why aren’t you upgrading to vs 2015?

what do you mean by infinite loop?

check your debug type, it’s sometimes the older PDB format that causes slow compiles. Does release compile quicker? I think it’s Z7 that works ok, not as good debug info, but should be able to still debug in limited fashion.

Yeah upgrade to 2015 update 1 if you want much faster compiler times due to the improved incremental PDB format and whatever else they improved.

I will try to upgrade to 2015. Yes I think release compiles faster, what’s Z7?

Debug flag, nothing to worry about really, but it’s in the project settings (compiler, linker, etc). YMMV, but our build time improved substantially I think because it would always recompile everything even if you changed a single cpp file.

/Z7, /Zi, /ZI flag info
https://msdn.microsoft.com/en-us/library/958x11bc.aspx

1 Like

I’ll check this out. Thanks! :slight_smile:

if you want to still debug, /Z7 may or may not speed up your compilation. Note this may not speed up anything, but there’s a chance it may. The PDB issues, from poor memory, was related to cocos2d mostly and the Action classes…??

Anyway, if your able VS2015 really is the smart path forward.

1 Like

I have another idea, what if we make other .cpp to a dll? so that only the .cpp we constantly change will be compiled again. Is my idea good?

You are right /Z7 made it faster

@stevetranby thnx for the tip, works fast in vs 2015 also.

Yes your idea is very good.

Another potential feature of dynamic loading (instead of a static lib) you can checkout handmade hero on how he’s doing that for Win32, and the site’s forums on ports to mac using .dylib for dynamic hot loading, it’s a cool feature for separation, but also for potential hot-loading code to further reduce compile inefficiencies :smiley: granted you could also just hotload data files or Lua/javascript scripts to get similar behavior, but then you have to use two languages :expressionless:

I believe it’s week 5 that has the videos of interest regarding this
https://hero.handmadedev.org/jace/guide/
https://hero.handmadedev.org/jace/resources/
(not really promoting this or telling you to follow, watch, or otherwise engage over there, but it’s the most recent info on that idea that I’ve seen/read)

Also, even just using a static lib instead of dll would help a lot for sure and you should find pre-built cocos2d in the latest 3.10 or otherwise for sure in 3.11. You may want to test out a new project creation (maybe even use the new Cocos tool to do this) so you can see how the project is setup.

Have a look at RapidGame as an alternative to cocos2d’s pre-built libs, though while better it does sort of require having a different project setup than the core engine’s version.

Anyway, just some additional thoughts.

2 Likes

Thanks! :smiley: I’ll try to setup this