SSJS on every page - perf issues?

(John gill) #1

I’m considering using SSJS in the global Paint Layout on a site, and wondering if anyone has run into any performance issues caused by requiring making every single page to be run through the SSJS process.

Obviously all the usual “mileage my vary” caveats apply, but it’s hard to benchmark something like this so just curious if there are any Cautionary Tales out there.

(David Schoen) #2

As long as you’re using V8JS, the overhead is minimal as the JS is run in the same process with a fairly efficient bridge between both language VMs.

(John gill) #3

Thanks David.

So using SSJS as part of a side nav or some other global component wouldn’t be uncommon?

(David Schoen) #4

I don’t have hard numbers, but I expect most of our internal builds involve at least some SSJS in as few areas common to all pages now.

(Bart Banda) #5

SSJS is used really frequently in Squiz builds these days and one of the reasons is actually because it often makes for more performant pages, if used correctly of course. For example, it’s quicker to just use SSJS with the %asset_children% to print some child assets as Matrix has to process less assets (things like checking permissions on each asset in the page generation eliminated). I’d def recommend using SSJS where you can, especially if you can eliminate the need of using some assets in the templating.