I just updated an afterSubmit script that loaded t...
# suitescript
j
I just updated an afterSubmit script that loaded the order, looped through every line to check if a kit for another function, then saves when done to a beforeSubmit script that finds each line that is a kit rather than looping through each line and does not require loading/saving. How/where can I see the performance impact? -- In APM, would this be a Network or Server performance change? How can I see performance change on orders created via Suitelet?
b
Unless you only have 1 script/workflow deployed, you want to be Analyzing Scripts
In general, most of the tools from APM are focused on ui, so you probably want to be looking at the impacts on the ui and extrapolating it to the suitelet
e
If you have control over the Suitelet, you can do your own timing in the code and log the results or send them to a custom record or external system. Potentially add something like a feature flag to your User Event to flip between the old approach and the new approach. You can get pretty fancy, but probably some quick timings and log entries are enough to get some anecdotal comparisons
j
Do the consequences of saving a transaction (all the scripts and workflows that take place) on afterSubmit count towards the script's performance? In another words, does the script's runtime continue to increment until all script and workflows have taken place after saving the transaction?
e
AFAIK,
afterSubmit
is synchronous, so I believe any
afterSubmit
customizations will impact all
save
operations.
There's nuance in that many of those customizations might have some Context Filtering on them and won't necessarily be triggered by your Suitelet, but in general,
afterSubmit
operations should still be considered in your performance assessment.
j
Thank you all. Based on what I am seeing in SuiteScript Analysis, I brought a ~2 second runtime down to .09 seconds on average!