Compilation time

Monkey Targets Forums/Desktop/Compilation time

ziggy(Posted 2014) [#1]
It gets several minutes to compile a very simple application that uses lots of reflection.
Anyway to improve this? It's getting to a point that it's too much to be sane


Nobuyuki(Posted 2014) [#2]
Use msbuild, it's faster than GCC :B

Or change optimization flags in command line...


Arjailer(Posted 2014) [#3]
Yeah, I found switching from GCC to Visual Studio cut my builds from almost 3 minutes to under 30 seconds (sometimes as low as 10 seconds on a good day).

Even if you want to switch back to GCC for release builds it reduced the frustration of development for me considerably :-)


MikeHart(Posted 2014) [#4]
As nice as reflection is, it can add a huge heap of code to your app. I am not surprised that it takes way longer. Switching the compiler only helps there. Using reflection can extend the parsing and build process big time.


ziggy(Posted 2014) [#5]
As nice as reflection is, it can add a huge heap of code to your app. I am not surprised that it takes way longer. Switching the compiler only helps there. Using reflection can extend the parsing and build process big time.
that's true, but as we lack Delegates, reflection is the only way to provide a decent event system. (I know it can be done using interfaces ala Java, but I was talking about a "decent" system) In the other hand the same code in JavaScript + HTML5 compiles with the blink of an eye, so it's not the Monkey side of things. I wonder why we can't have a switch or something like a switch to pre-compile modules on c++ targets.


Powelly(Posted 2014) [#6]
You could try using the XNA target, as the C# compiler is much faster than a C++ compiler.
You'll need to return to C++ for debugging though.

I might have to look and see how much work a "D" (http://dlang.org/) target would be, as that would give you native C++ speed, but with much faster compile times.


ziggy(Posted 2014) [#7]
Yes, I know D and love it. Not sure how complicated it would be but there are lots of things in Monkey that resembles D. I *think* a D target with support for SDL could maybe be a nice alternative to C++ with GLFW