About Monkey 2 › Forums › General Programming Discussion › How fast does monkey2 compile?
This topic contains 10 replies, has 5 voices, and was last updated by 
 Ethernaut
 2 years, 2 months ago.
- 
		AuthorPosts
 - 
		
			
				
January 11, 2017 at 4:05 pm #6415
I have a monkey 1 project with around 37000 lines of code and it takes around 5-6 seconds to parse, semant and translate the code (Html5 target). Does anyone here have a project comparable in size in monkey2?
5-6 seconds isn’t that long if you compare it with other solutions, but it’s long for game dev iteration.
PS: Also I just saw this video and couldn’t believe how fast it was: https://www.youtube.com/watch?v=14zlJ98gJKA
The guy compiles a 33kloc program in 0.38 seconds. And that’s on a laptop with an i7@2.6ghzJanuary 12, 2017 at 1:48 am #6429I have no a big project. Parse, semant and translate working fast in monkey2, but there are additional Compiling and Linking stages that takes more time. How much – need a big project to try. But about 5 secs at all for my small project.
Compiling time also depends on what files you modified – if code from this file is used in many other files than less cache will be used and it takes more time.
February 7, 2017 at 5:32 pm #6984The takeaway from the video I posted is that computers today are very fast, but we don’t use it’s full potential.
The reason it’s so important in this case, is that it’s at the core of our development cycle:Change code -> compile -> verify -> repeat
If the compile step takes too long it can be very irritating. Even the 5-6 seconds in mx1 “feel” long to me. I get that this might be an unsolvable problem, because mx2 compiles down to C++ (which doesn’t have the fastest compile times).
Is mx2 already doing iterative compiling where it doesn’t recompile everything?
I am not up to date with mx2, sorry for obvious questions.
February 8, 2017 at 12:17 am #7011Is mx2 already doing iterative compiling where it doesn’t recompile everything?
Yes. First compile is slow but next are faster.
February 8, 2017 at 9:26 am #7012I’m finding Monkey 2 is quite slow to build to the Desktop target (I can’t build to Emscripten as I use Fibers in a few places).
My project is currently ~9000 lines of code (~13800 lines total, including blank lines and comments) and a first build takes around 80 seconds, with subsequent builds taking around 40 seconds on an i7-4800MQ with 32GB ram on 64-bit Windows 7.
February 8, 2017 at 9:52 am #7013> I’m finding Monkey 2 is quite slow to build to the Desktop target
Are you using v1.1.03?
There were some bugs in recent pre-v1.1.03 versions that meant mx2cc was compiling more that it should have been. If you using v1.1.03, then link times are likely the problems and there’s not much I can do about that.
I also need to get around to supporting msvc compilers, I have a feeling these will be significantly faster too. Looks like this is become semi-urgent!
February 8, 2017 at 10:11 am #7014I’m currently using 1.1.02 – will try 1.1.03 later today.
With Monkey 1 I found the MSVC compiler to be much faster than MinGW – it cut my compile times from around 3 minutes to under 30 seconds – so that would be a welcome addition.
But I’m not complaining as such about the Monkey 2 compile times – I’m well aware that C++ compilation is slow – just thought that the OP should be aware that sub-second compiles aren’t going to happen with sizeable M2 projects
February 8, 2017 at 11:20 am #70151.1.03 isn’t much different, still ~40 seconds, maybe a second or two quicker.
February 8, 2017 at 9:55 pm #7028Any chance you can email me the project, it shouldn’t be that bad!
February 9, 2017 at 12:15 pm #7057I’ve emailed you the project.
February 10, 2017 at 8:34 am #7079I often get a slowish first compile, but then it gets really fast (under 2 seconds) for subsequent changes/compiles, unless I make major changes that affect several source files. That’s about the same I was getting when changing Unity scripts.
I’m on a 2.5Ghz, quad core i7 Macbook.
Out of curiosity, how do you count all the lines of code in a lot of imported files?
<edit>
Figured it! Running this command line at the root directory of your project will do the trick.
find . -name “*.monkey2” | xargs wc -l - 
		AuthorPosts
 
You must be logged in to reply to this topic.