On Thu, Jun 13, 2013 at 11:42 AM, Doug Koellmer <[email protected]> wrote:

> I understand generally that, if you're on a modern browser, it means you
> can take arbitrary JS and cajole it client-side. Are their any overall
> performance benefits to this? Is the client-side cajoler noticeably faster
> than the server-side cajoler? Does the client-side cajoler produce faster
> code?
>

ES5 mode uses the browser's own JS engine features for sandboxing. This
means that all sandboxed JS and our own virtualization layers run much
faster, because we don't have to transform and interpose on every property
lookup. I don't think we've benchmarked the cost of the
content-processing-pipeline component, specifically, of the old and new
worlds — but the overall load time is cut to around 1/3 to 1/5 of what it
was with the cajoler and ES5/3. (Numbers I had handy, not rigorously
measured.)


> Currently I don't see a benefit to switching to SES mode if there are no
> performance considerations...maybe there are other considerations?
>

You also get a virtual JS environment which is not constrained by the
absence of 'eval', and generally has fewer caveats:
https://code.google.com/p/google-caja/wiki/DifferencesBetweenES5Over3AndES5

A new restriction: the standard JS global objects are all frozen. (As far
as we can tell, nobody actually minds.) Besides being simpler (for us,
anyway), this also contributes to performance as loading multiple guest
environments doesn't need to create a fresh iframe.

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Google Caja Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to