Duration of build until simulator shows up

I have a question about the duration of the build of a data field until it is displayed in the simulator:
I am developing a data field for Edge devices (VS Code) with quite a lot of data and choices. In the beginning (with less data and features) the build time was about one minute.
Since I added some features lately, after each extension of the code the build time increased dramatically.
Currently the build process takes almost 5 minutes until the simulator shows up.
The data field itself only takes about half of the available memory on the Edge (shown in sim).
It is the following data field (so you can estimate the compilation effort):
apps.garmin.com/.../cd433835-4089-476b-a0cf-0c13db63a18c

I'm wondering now:
-Could it be less power of the PC? (Lenovo ThinkPad T570, i5-7300U, 8 GB RAM) 
-or is the time for the build quite normal under these circumstances?
-can it be due to bad coding? (I'm pretty new to Monkey-C)

Thanks for your answers!

  • Do you think I should remove and install VS Code anew?

    I never have added another than Monkey C Extension. And all my codes are very simple and refer to no 3rd party tool.

    Unfortunately I cannot send you a PM. I think about to send you my project for a test. If you agree you‘re welcomed to send me a PM. But as I said - Of yourse I don‘t want to get your nerves… Wink

  • You can simply check who is the culprit - VS Code or Monkey C JAR itself by executing a corresponding build command from the Terminal tab in VS Code.

    1) Run build from VS Code using Ctrl+F5

    2) Copy the corresponding build command from the Terminal tab in VS Code

    3) Start Windows Command Line and go there to your project root folder

    4) Paste the command, execute it, and see how much time it takes to build the PRG.

    The command should look similar to this:

    D:\jdk-17.0.2\bin\java.exe -Xms1g -Dfile.encoding=UTF-8 -Dapple.awt.UIElement=true -jar c:\Users\Admin\AppData\Roaming\Garmin\ConnectIQ\Sdks\connectiq-sdk-win-4.1.6-2022-11-04-17f8cfdf3\bin\monkeybrains.jar -o bin\myapp.prg -f d:\apps\myapp\monkey.jungle;d:\apps\myapp\barrels.jungle -y "d:\Program Files\developer_key" -d edge1030_sim -w -l 1

    Note that if you have spaces in some of your paths then you additionally need to surround it with double quotes (like "D:\Program Files" in the example above) 

  • Thank you - I did what you suggested:

    "C:\Program Files (x86)\Common Files\Oracle\Java\javapath\java.exe" -Xms1g -Dfile.encoding=UTF-8 -Dapple.awt.UIElement=true -jar c:\Users\Lenovo\AppData\Roaming\Garmin\ConnectIQ\Sdks\connectiq-sdk-win-6.2.1-2023-06-26-124cb49c5\bin\monkeybrains.jar -o bin\EdgeAllinOne1.prg -f c:\Garmin_IQ_Projekte\EdgeAllinOne1\monkey.jungle -y c:\Garmin_IQ_SDK\developer_key -d edge1040_sim -w
    

    No difference in build time.

    To get an idea of the size of the project: most of the code is in View.mc - it has about 3,200 lines (with some remarked and some blank lines, of course...)
    Is that already a lot?

  • THERE ARE INCREDIBLE NEWS!

    I remebered that the problem with increasing build time started when I first added CONTRIBUTE. Edge battery and gear shift index can be written into the activity fit file on demand.

    I removed the Contribute permission and the according parts of code from my project for testing purpose. There was not much code to eliminate: a resources XML and some lines in Initialize and onCompute.

    And ... drummroll ... the build time now is incredible 15 seconds!

    How can that be?
    I know that some users like this feature and I will not withdraw it.

    Here is the eliminated code:

    resources XML

    <resources>
    
        <strings>
    
            <string id="battery_label">Device Battery</string>
            <string id="batterygraph_label">Device Battery</string>
            <string id="battery_units">%</string>
    
            <string id="rshift_label">Rear Shift</string>
            <string id="rshiftgraph_label">Rear Shift</string>
            <string id="rshift_units">Idx</string>
    
            <string id="fshift_label">Front Shift</string>
            <string id="fshiftgraph_label">Front Shift</string>
            <string id="fshift_units">Idx</string>
    
        </strings>
    
        <fitContributions>
    
            <fitField id="1" displayInChart="true" sortOrder = "1" precision="0"
            chartTitle="@Strings.batterygraph_label" dataLabel="@Strings.battery_label"
            unitLabel="@Strings.battery_units" fillColor="#38C8F8" />
    
            <fitField id="2" displayInChart="true" sortOrder = "2" precision="0"
            chartTitle="@Strings.fshiftgraph_label" dataLabel="@Strings.fshift_label"
            unitLabel="@Strings.fshift_units" fillColor="#FF8080" />
        
            <fitField id="3" displayInChart="true" sortOrder = "3" precision="0"
            chartTitle="@Strings.rshiftgraph_label" dataLabel="@Strings.rshift_label"
            unitLabel="@Strings.rshift_units" fillColor="#FF8080" />
    
    
        </fitContributions>
    
    </resources>
    

    Initialize:

            /*
            if ( showBatteryGC == true )    {
                mybatteryField = createField("devicebattery", batteryID,  FitContributor.DATA_TYPE_UINT8, {:mesgType=>FitContributor.MESG_TYPE_RECORD, :units=>"%"} );
                if ( mybatteryField != null ) {
                    mybatteryField.setData(0);
                }    
            }
    
            if ( showShiftGC == true and gearArt > 0 )    {
                if ( gearArt == 3 ) {       // front Gear
                    myfshiftField = createField("frontShift", fshiftID,  FitContributor.DATA_TYPE_UINT8, {:mesgType=>FitContributor.MESG_TYPE_RECORD, :units=>"Idx"} );
                    if ( myfshiftField != null ) {
                        myfshiftField.setData(0);
                    }    
                }    
                myrshiftField = createField("rearShift", rshiftID,  FitContributor.DATA_TYPE_UINT8, {:mesgType=>FitContributor.MESG_TYPE_RECORD, :units=>"Idx"} );
                if ( myrshiftField != null ) {
                    myrshiftField.setData(0);
                }    
            }
            */

    onCompute:

                /*
                if ( mybatteryField != null ) {
                        mybatteryField.setData(akku);
                }        
                */
    
                /*
                 if ( myfshiftField != null ) {
                    myfshiftField.setData(curGearF);
                }    
                 if ( myrshiftField != null ) {
                    myrshiftField.setData(curGear);
                }    
                */

  • Wow. I would file a bug report and send Garmin a copy of your project.

  • What I did now:

    I added the Contributions step by step and stopped the build time:

    -with no Contribution at all:    15 seconds

    -added the first Contribution (Edge battery):  1:15 min

    -added the second Contribution (Front shift Index):  2:20 min

    -added the third Contribution (Rear shift index):  4:50 minutes

    I will now make a small project only with Contributions and will see. If it's the same, I will file a bug report and send that project.

    Thanks for all!