Impossible compile times

I took the source from an already functional data field and everything works quite well with Visual Studio Code, Eclipse Adoptium\jdk-20.0.2.9-hotspot, connectiq-sdk-win-6.3.1-2023-09-25-47b193194. The result is executable. But the compilation times are beyond bearable. A "Run without Debugging" has been running for 2 hours and I'm waiting. A similar source code runs for 30-60 minutes each time. Exporting to an IQ file takes approx. 2 hours. I'm new to MonkeyC and can understand a lot, but that can't be normal. You can't work like that. Does anyone have a tip for me on how I can make compile times faster?

  • This looks very similar to the same issue reported. The good news is we're currently working on a fix for it. In the mean time, try turning off type checking and compiling again. 

  • Wow, that was the tip. Now the build only takes 3-5s instead of 30min. Many thanks

  • I have now learned here for the first time that typecheck off can be a solution to the problem. Just tried it, and - bingo! Buildtime is down to a few seconds again!

    Disadvantage:
    you will get no error message at build time if there is any failure in your code. So, it is not a sulution for developing time - only for export to .iq!

  • Is this fixed in the 6.3.1 SDK?  I don't have any apps that exhibit this issue so I can't try it myself.

    Ok, looks like the OP was using 6.3.1 so I guess the answer is "no"

  • No, it‘s not fixed.

    But I have made an additional observation on that case (at least with my code…):
    There is a maximum of possible declarations of var for a class. About little more than 230. The more you get near to that amount the more the build time increases exponentially. So, it seems not only contributes but also the amount of declared variables come into play, if typecheck is on.

  • This may have something to do with the apparent use of ANTLR for Monkey C source code parsing. (I can tell it's ANTLR because of the format of the language syntax error messages).

    I've used ANTLR for a project at work involving code analysis / generation, and if the code to be analyzed exceeds a certain threshold of complexity, ANTLR just runs "forever". (I mean maybe it would finish eventually, but I gave up waiting after about an hour or so.)

  • Thank you for this background insight. Very interesting!