Question about loading time for MCR-files

Question about loading time for MCR-files

Haider_of_Sweden
Collaborator Collaborator
876 Views
5 Replies
Message 1 of 6

Question about loading time for MCR-files

Haider_of_Sweden
Collaborator
Collaborator

I'm curious about potential loading time differences between having an MCR containing the full script compared to a small row that loads an MS file (fileIn "filename.ms") when the button or menu item is pressed.

 

In simpler terms, during loading, is the full MCR evaluated, or just the 'header' (macro name, tooltip, etc.)?

0 Likes
Accepted solutions (1)
877 Views
5 Replies
Replies (5)
Message 2 of 6

denisT.MaxDoctor
Advisor
Advisor
Accepted solution

The entire MCR is evaluated upon loading, but it is a quick process and should not cause any issues. However, if you experience a long loading time, it may indicate a specific problem that requires attention.

0 Likes
Message 3 of 6

denisT.MaxDoctor
Advisor
Advisor

@Haider_of_Sweden wrote:

I'm curious about potential loading time differences between having an MCR containing the full script compared to a small row that loads an MS file (fileIn "filename.ms") when the button or menu item is pressed.

 


The usage of filein is a deprecated MXS technique and should not be used in modern mxs coding practices. (IMHO) 

0 Likes
Message 4 of 6

Haider_of_Sweden
Collaborator
Collaborator

@denisT.MaxDoctor wrote:

The entire MCR is evaluated upon loading, but it is a quick process and should not cause any issues. However, if you experience a long loading time, it may indicate a specific problem that requires attention.


That answers my question, but I will rename the scripts folder and observe if the startup speed is affected or not.

 


@denisT.MaxDoctor wrote:

The usage of filein is a deprecated MXS technique and should not be used in modern mxs coding practices. (IMHO) 


Just to clarify, are you suggesting that the script inside the .MS file should be placed in an .MCR file instead, and therefore I should not use "filein"? Or did you have any thoughts on "filein" specifically?

0 Likes
Message 5 of 6

denisT.MaxDoctor
Advisor
Advisor

On the CGTalk forum (now defunct) I showed in quite a bit of detail how to do "one tool - one file - one global - one structure". In a nutshell, everything is in one MS file in one of the "plugin" folders. This file can contain only one global structure defining the body of the tool(s), user interface, user settings, and launcher of the tool(s) - as a micro-definition.

0 Likes
Message 6 of 6

denisT.MaxDoctor
Advisor
Advisor

In another post on the same CGTalk forum, I talked about the disadvantages of using the filein method...

0 Likes