2021.1

Table Of Contents
Tip
Functions that actually change the content of the template (for example,append()) are
comparatively time consuming. Avoid using such functions in a loop. For more tips, see
"Optimizing scripts" on the next page.
Note that the times vary slightly per run of the Script Profiler. Run the Script Profiler a number of
times and calculate an average from the results, before trying to speed up the execution of a
script.
Script Profiler settings
Number of runs
By default, the Script Profiler runs on 1000 instances of all the scripts. To test on a higher or
lower number of instances:
1. On the menu, select Window > Preferences.
2. Click Scripting.
3. Set a number of iterations (maximum one billion) and click OK.
Sorting
In the Scripts Profiler, the scripts are by default sorted based on the values in the Elapsed
column, from high to low. Click any of the columns to sort the scripts according to the values in
that column.
Script timeout
When testing scripts, either by toggling to Preview mode or by using the Script Profiler, a script
timeout is active in the Designer, so that scripts that need a very long time to run are stopped
after a set time. You can adapt this timeout to your needs, as follows:
1. On the menu, select Window > Preferences.
2. Click Scripting.
3. Set a timeout in seconds (for example: 2s) and click OK. The minimum timeout is 1
second.
Page 882