2022.2

Table Of Contents
l
Theselectorhasnomatchesatanytime.(Thismaydependonotherscripts,sincescriptscan
addorremovecontent.)
l
Thescriptisexcludedthroughthepropertiesofitsparentfolder.
ForanexplanationofthebuttonsintheScriptDebugger,see"ScriptDebugger"onpage475.
Testingforspeedissues
Tomeasurethetimethattheexecutionofscriptswilltake:
l
OntheContextmenu,clickProfile scripts.
Profilingmeansrunningthescriptsinthetemplate,withthecurrentrecord,toseehowfastscriptsin
theScriptspaneexecute.Ithelpsgreatlyintroubleshootingperformanceissuescausedbyscripts.
AfterrunningtheScriptProfileryoucanseeinwhichsectionsthescripthasrun:
l
HoverthemouseoveravalueinthecolumnCounttoseethenumberoftimesthatthescripthas
run,persection.
Youcanalsoseethebreakdownoftheexecutiontimeacrossdifferentexecutionstages:
l
HoverthemouseoveravalueinthecolumnElapsedtoseethetimeelapsed(inmilliseconds)
sincethestartofthesession.IntheScriptsProfiler,thescriptsarebydefaultsortedbasedonthe
valuesintheElapsedcolumn,fromhightolow.
l
HoverthemouseoveravaluethecolumnDeltatoseethedifferencebetweenthetimeelapsed
(inmilliseconds)intheprevioussessionandinthecurrentsession.
Thescriptexecutionstagesare:
Query:thetimeittakestofindtheselectorinthetemplate.
Tip: Lookingfortextisaratherlengthyoperation.UseanIDorclass(possiblyincombination
withatext)insteadofatextselectortomakethequeryfaster.Formoretips,see"Optimizing
scripts"onthefacingpage.
Execution:thetimeittakestoexecutethescript.IfyouareanexperiencedJavaScriptcoderyoumay
beabletooptimizethecodetospeeduptheexecutionofthescript.
Tip: Functionsthatactuallychangethecontentofthetemplate(forexample,append())arecom-
parativelytimeconsuming.Avoidusingsuchfunctionsinaloop.Formoretips,see"Optimizing
scripts"below.
NotethatthetimesvaryslightlyperrunoftheScriptProfiler.RuntheScriptProfileranumberoftimes
andcalculateanaveragefromtheresults,beforetryingtospeeduptheexecutionofascript.
Page 379