How fast does monkey2 compile?

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, 4 months ago.

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #6415

    shinkiro1
    Participant

    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.6ghz

    #6429

    nerobot
    Participant

    I 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.

    #6984

    shinkiro1
    Participant

    The 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.

    #7011

    nerobot
    Participant

    Is mx2 already doing iterative compiling where it doesn’t recompile everything?

    Yes. First compile is slow but next are faster.

    #7012

    Arjailer
    Participant

    I’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.

    #7013

    Mark Sibly
    Keymaster

    > 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!

    #7014

    Arjailer
    Participant

    I’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  🙂

    #7015

    Arjailer
    Participant

    1.1.03 isn’t much different, still ~40 seconds, maybe a second or two quicker.

    #7028

    Mark Sibly
    Keymaster

    Any chance you can email me the project, it shouldn’t be that bad!

    #7057

    Arjailer
    Participant

    I’ve emailed you the project.

    #7079

    Ethernaut
    Participant

    I 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

Viewing 11 posts - 1 through 11 (of 11 total)

You must be logged in to reply to this topic.