Slow compile times?

BlitzMax Forums/BlitzMax Beginners Area/Slow compile times?

QuickSilva(Posted 2008) [#1]
When compiling a large source file BMax seems to take ages. I`m using a 1.5ghz processor and have been thinking of upgrading. Would a better processor make a noticable difference or am I just being impatient?

Jason.


MGE(Posted 2008) [#2]
Faster is always better. How long is it taking to compile? A 1.5 ghz is pretty slow, plus how is your hard drive? That can slow down things as well.


Brucey(Posted 2008) [#3]
How large is large? :-)


Gabriel(Posted 2008) [#4]
If you can, splitting the large source file into chunks which can be IMPORTed ( not INCLUDEd ) will massively boost your compile time. Make sure you have quick build enabled too, of course. My project runs to well over 5MB of source and I can compile the whole thing in about a minute, a typical quick-build compile taking about 30 seconds, so the compiler is decent, but not remotely as fast as a really good compiler like MS VC++.

Since you've only got a 1.5ghz one, a better processor would surely help quite a bit, but try the cheap ideas first. I don't quite know why it should be so but MGE is right, the compiler does seem to thrash the hard drive quite a bit, so that *could* also be an issue.


Brucey(Posted 2008) [#5]
And don't forget the secret compiler speedup option if you get really desperate (although this is only useful when you use IMPORT).

set the environment variable, BMK_SPEEDUP to something. (like true, or 1)

super-handy if you are building large apps of multiple files, or modules. Can cut a 10 minute build down to less than 1, depending on the changes.

;-)


Macguffin(Posted 2008) [#6]
Any reason everyone wouldn't want that last one on all the time?


QuickSilva(Posted 2008) [#7]
How do you set the environment variable Brucey? Sorry but I haven`t a clue.

Thanks for the other suggestions. I`ll give them a try. I have been including my files so I will be sure to import them from now on.

Quick build is enabled so it`s not that.

Just out of interest and I know nothing about these things but would it have not been possible to get super speedy compile times like in B3D by not optimizing the code when in debug mode and only optimizing it in release mode?

Jason.


MGE(Posted 2008) [#8]
QuickSilva, how long does it take your current source to compile?

Brucey - Whoah....is there a walk through for that somewhere? Thanks!


Brucey(Posted 2008) [#9]
Any reason everyone wouldn't want that last one on all the time?

Not that I know of.

How do you set the environment variable?

On XP, you'd do something like... right click on My Computer -> Properties -> Advanced -> Environment Variables. Add a New variable called BMK_SPEEDUP, and give it a value, say, 1.
For XP onwards, the setting will be picked up when you next start the IDE/bmk. Otherwise, (for Win2k or less) you'll need to restart the PC.

Think of it like a Super-Quick-Build. What it does is look for "API" changes in your code, and only rebuild connected files if the API changed. An API change would include : adding/removing a method/function, changing method/function params, adding/removing Globals/Consts.

Remember, this is only useful if you have lots of IMPORTed files, since each file is compiled into an object file on its own. For INCLUDEd files, or single very-large files, neither Quick Build nor this setting will give you any benefit.

Oh, and the setting will only take effect on the second build - the first time, it will create some cache data. And for apps, it only applies with Quick Build enabled. For modules it doesn't matter if you have Quick Build on or off.

:o)


Azathoth(Posted 2008) [#10]
The bmk_make.bmx source calls the BMK_SPEEDUP experimental.


Brucey(Posted 2008) [#11]
Indeed, but I've never had any problems with it.

But then... I'm willing to experiment...


Yan(Posted 2008) [#12]
I seem to remember reading somewhere that there can, potentially, be problems with deleted .bmx files.

Having said that, I don't recall having had any problems either but then again, I only really dabble with BMax these days.


Grisu(Posted 2008) [#13]
You might gain another tiny speed boost from using a newer version of fasm.
-> http://flatassembler.net/download.php

Bmx 1.30 still comes with the outdated version 1.66 which dates back to 2006. In the meantime they have fixed tons of stuff and added SSSE3 + 4 support.


xlsior(Posted 2008) [#14]
Bmx 1.30 still comes with the outdated version 1.66 which dates back to 2006. In the meantime they have fixed tons of stuff and added SSSE3 + 4 support.


FWIW -- the SVN version of BlitzMax currently uses 1.67.26

(The latest version of FASM is 1.67.27)


Grisu(Posted 2008) [#15]
FWIW -- the SVN version of BlitzMax currently uses 1.67.26


FWIW - I wasn't talking of the SVN version, just the full bmx 1.30 installer that was released in june this year. It comes with 1.66. - Not everyone is using SVN as you might know.