Precompile macros on Startup

Post anything you want to discuss with others about the software.

Precompile macros on Startup

Postby ger21 » Mon Nov 28, 2016 12:27 am

If you have a lot of macros, this new option can make UCCNC load really slowly.
I currently have about 250 macros for my screenset, and pre-compiling them adds about 50 seconds to the start time (I timed it).
Gerry
UCCNC 2022 Screenset - http://www.thecncwoodworker.com/2022.html
ger21
 
Posts: 2671
Joined: Sat Sep 03, 2016 2:17 am

Re: Precompile macros on Startup

Postby A_Camera » Mon Nov 28, 2016 9:42 am

I can see it is a disadvantage for the startup if you have 250 macros to compile, and it should be done only once if the files are unchanged, but that demands version control. UCCNC in my opinion is already a pretty slow starting software, so compiling 250 macros every time it starts is not a very good option. Perhaps the other option, compiling after first use is better. Anyway, I'd prefer a third option as well, that is keep it as it was before, so three radio buttons, one for compile all macros during startup, one for compile at first use (only the used macros) and one for no change, keep it as it was before this release.
A_Camera
 
Posts: 638
Joined: Tue Sep 20, 2016 11:37 am

Re: Precompile macros on Startup

Postby cncdrive » Mon Nov 28, 2016 10:27 am

Yes, if precompiling then the compiling time is added to the startup.
The 250macros for 50sec sounds realistic, it is 0.2sec per macro, which is possible.
With the default macros 20pcs on my computer these compile exactly in 1 seconds, but this is a i7 PC with DDR4 RAMs.

The problem with the option you've mentioned (precompiling and storing in files) is that the UCCNC can be run in more instances and it is very problematic to save the precompiled files, because there could be a race condition between the more instances when they would try to save the files.
Guess what happens if more than one instances are open and wants to save because the macros changes, this in my opinion involves some possible "random" happening which is not really good is why we avoided this solution. Also guess what happens if one instance try to save the file while the other try to load it.
cncdrive
Site Admin
 
Posts: 4717
Joined: Tue Aug 12, 2014 11:17 pm

Re: Precompile macros on Startup

Postby ger21 » Mon Nov 28, 2016 11:32 am

Perhaps the other option, compiling after first use is better. Anyway, I'd prefer a third option as well, that is keep it as it was before,


As I mentioned in the other thread, compiling after first use works very well, and is a huge improvement over the old way. And there's no noticeable performance hit when starting. So I can't see a reason to go back to the old way.
Gerry
UCCNC 2022 Screenset - http://www.thecncwoodworker.com/2022.html
ger21
 
Posts: 2671
Joined: Sat Sep 03, 2016 2:17 am

Re: Precompile macros on Startup

Postby cncdrive » Mon Nov 28, 2016 11:49 am

Vmax549 wrote:Also how is UCCNC going to do error checking for a bad macro on load ??? Will it give an error message. Will it STOP the loading ?? or give a message and continue on loading by passing teh bad macro.

(;-) TP


Error reporting works the same as in earlier versions.
The error reporting happens not on the compile, but when the macro is run.
When compiling the UCCNC already knows if the macro has a problem or not, if the macro file is missing or if it has errorous code, but reporting the issue only when you try to run the macro.
The only thing what is unknown on compilation time is if the macro will have a runtime error, e.g. a division by zero.

So, this part works the same as before.
cncdrive
Site Admin
 
Posts: 4717
Joined: Tue Aug 12, 2014 11:17 pm

Re: Precompile macros on Startup

Postby ger21 » Mon Nov 28, 2016 6:35 pm

I run two instances while doing screen design, to get button and LED numbers from the stock screen.
Gerry
UCCNC 2022 Screenset - http://www.thecncwoodworker.com/2022.html
ger21
 
Posts: 2671
Joined: Sat Sep 03, 2016 2:17 am

Re: Precompile macros on Startup

Postby cncdrive » Mon Nov 28, 2016 7:33 pm

Hey Terry,

You can't tie instances together, but for example you can control 2 machines the same time with running separate UCCNC instances on one PC.
There are command line arguments which lets you control if you want to connect the UCCNC to one specific serial number motion controller only.
So, you can have one icon with command line arguments defined which will always connect to e.g. controller with serial 000001 and the other icon to e.g S/N 000002,
so you can control which motion controller to connect to with the different shortcut icons.
These command line arguments are described in the UCCNC manual.

I know customers who run 2 instances of UCCNC to control 2 machines from the same PC. :)
cncdrive
Site Admin
 
Posts: 4717
Joined: Tue Aug 12, 2014 11:17 pm


Return to General discussion about the UCCNC software

Who is online

Users browsing this forum: No registered users and 17 guests