简体   繁体   中英

Will the unused modules or functions affect the execution speed of SuiteScript?

A script on NetSuite as the following, it is a Client Script which written in JavaScript with the API 2.0 of SuiteScript:

define(['N/currentRecord','N/record','N/search'],
    function(currentRecord, record, search) {
         for(i = 0; i< 10000; i++) {
                ...
         }    
         function a() {}
    }

    return {
        pageInit: pageInit
    };
});

But there is nothing about the included modules(N/currentRecord, N/record and N/search) in the script.

Will the unused module inside the define() function affect the execution speed of SuiteScript or NetSuite?

And how about the unused function a()? Will it affect the performance of this script?

Technically, yes, both will affect the performance, but it should be minuscule. I highly doubt it will be at all noticeable or consequential.

So many other things in NetSuite operate on the order of seconds (searches, loading records, loading pages) that a few extra micro- or milliseconds to load a library or define a function will be completely inconsequential to the user's experience.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM