SuiteQL vs. Search.lookupFields: Performance compared

Ever since the release of SuiteQL since in NetSuite 2020.1, developers are alternating between the usage of SuiteQL and N/search module. Some still prefers to use the N/search module while the others are using the new N/query module.

In this SuiteUp post, we compared the performance of the two, and let us tell you, the results are surprising. Read on to know more.

To compare the performance of both of the modules, we did a simple test in a user event script that was deployed on the invoice record. It was set to run on edit mode and was written in SuiteScript 2.1.

We used both of these modules to get the parent ID from the customer. We added the time logs at the start and end of both statements. We edited the invoice record and saved it to trigger the user event. We did this multiple time to get the average instead of one-time result.

SuiteQL took between 0.029 – 0.043 second with average of 0.0341 second; while search.lookupfields took between 0.009 – 0.1 second and averaged at 0.0316 second.

One thing is worth mentioning that during our first run of the script, SuiteQL took longer compared to lookupFields. But the subsequent triggers decreased the total time. We got the following results for triggering the UE:

SuiteQL took 1.007 seconds vs. the 0.027 seconds for search.lookupFields.

It is clear from the results that both SuiteQL and search.lookupfields have almost same performance with a negligible difference. But search.lookupFields is faster at getting results if the queries are not repeated!

What do you use, SuiteQL or Search.lookupfields?

See also  Unlock Your NetSuite Certification: The Ultimate Guide

Leave a Reply

Your email address will not be published. Required fields are marked *