Notifications
Clear all

[Closed] Make a script less heavy

Hi,

At some point a script can get very heavy at load time because it needs to be loaded and evaluated completely (even if parts of it will never be used at a time).

I am wondering if it’s possible to break a script apart e.g. a seperate file per rollout and only load that part if it is in use or needed at a certain time.

Of course all these parts have comon variables that they share so maybe technically it is not possible?

Anyone a suggestion how to approach this?

Many thanks,
Davy

5 Replies

Check the documentation for filein and include

…ah yes I was only familiar with fileIn and not aware of the differences between fileIn and include (or even not aware of include) which gives options to make scripts work efficiently, even if they become large

Thanks!
Davy

…using “Include” to break up a script but I thought it would only load the include file when it was needed.

Looks like with include it takes about 2x as long (or longer) to load than without.
And no include file is needed at fresh script load.

So after all it’s not really making a difference.

Why is that?

Davy

I don’t know if this will help but there is an excellent section written by Bobo in the help about writing better and faster scripts, check under frequently asked questions.

J.

…yes but my script is already optimized but I will try even more

Davy