Hi,
Sorry about the delay in getting back to you on your question. (I thought I had configured myself to get alerts when new posts arrived here.)
To answer your question:
As you've noticed, the compile time performance of LabVIEW 8 MathScript increases exponentially as you increase script length. (The compile time performance here means the time that it takes to start to execute a script after you've made a change to the script.) We are working to improve this issue in a future release, but for now, one thing you can do to improve the compile time performance of your VI is to work to break up your script into smaller chunks of about 15-20 lines each. There are several ways you can do so:
- Use multiple MathScript Nodes in your VIs, each with sections of your code. Because each separate MathScript Node will have a unique variable namespace, you will want to share variables and data between nodes by using the Global command or by running wires between the nodes.
- Create user-defined functions that encapsulate parts of your script and call these from your main script.
Breaking up your scripts into smaller chunks can speed up compile time because it can localize any changes that you make to separate MathScript Nodes or user defined functions. When you make a change the LabVIEW MathScript compiler will only recompile the Node or function that contains the change.
You also asked if there is a way to disable auto-compiling every time a VI is saved. The MathScript Compiler does not actually recompile the m-file scripts with every save, it only does so when the script has been changed since the last save or run. With this release, there is no explicit switch configuration switch to set to disable this behavior, but a workaround to consider is that you can avoid a complete recompile by entering a temporary syntax error in the script that you want to disable the recompile for.
Finally, you might be interested in several other posts related to performance:
How fast is MathScript?and
MathScript in LabVIEW 8 is SlowI hope this helps and again, sorry about the slight delay in getting back to you.
Sam Shearman