Performance of Loading a Guest Page

34 views
Skip to first unread message

Jamey Wood

unread,
Nov 8, 2012, 11:52:11 AM11/8/12
to google-ca...@googlegroups.com
Is there any guidance on minimizing the time is takes a load a caja guest page?  The attached files demonstrate a little test case I'm using to measure the time it takes to load and run a trivial caja guest page.  Please let me know if there are any major issues with this methodology.

Here are samples of its output across three different browsers (all on a 2.2 GHz i7 MacBook Pro with 8GB of RAM):

  Chrome 23.0.1271.64:
    Total Time: 964ms (cold start in a new browser)
    Total Time: 740ms (after a few reloads in the same browser tab)

  Firefox 16.0.2:
    Total Time: 740ms (cold start in a new browser)
    Total Time: 762ms (after a few reloads in the same browser tab)

  Safari 6.0.2:
    Total Time: 502ms (cold start in a new browser)
    Total Time: 443ms (after a few reloads in the same browser tab)

I certainly wouldn't claim that this a valid full-blown benchmark.  But it does seem to give a general indication of the startup overhead for a caja guest on various browsers.

Are there any general practices that can be used to minimize this overhead?  Has anyone done more extensive tests along these lines?  And if so, did those tests produce similar results (such as the significantly better guest page load times on Safari versus Chrome or Firefox)?

Thanks,
Jamey
container.html
guest.html

Kevin Reid

unread,
Nov 8, 2012, 12:16:00 PM11/8/12
to google-ca...@googlegroups.com
On Thu, Nov 8, 2012 at 8:52 AM, Jamey Wood <jamey...@gmail.com> wrote:
Is there any guidance on minimizing the time is takes a load a caja guest page?  The attached files demonstrate a little test case I'm using to measure the time it takes to load and run a trivial caja guest page.  Please let me know if there are any major issues with this methodology.
[...]
Are there any general practices that can be used to minimize this overhead?

Practices? Stop using {forceES5Mode: false}. ES5 mode is the future and if it isn't significantly faster (on supported browsers), we want to know.

(Note that forceES5Mode is intended for debugging/testing purposes only and if set to true may cause insecurity. You should never use it in a public application. Its relative "es5Mode" is safer, if you must have a flag.)

Jamey Wood

unread,
Nov 8, 2012, 2:14:02 PM11/8/12
to google-ca...@googlegroups.com
Thanks, Kevin.

The reason I did that is that I'm not clear on how functional and production-ready ES5 mode really is.  When will it no longer be label as Experimental?

As one specific example, does it support external javascript library references?  When I change the little test case to use jquery (per the attached files), it stops working in Safari 6.  Is that expected at this point?

Thanks,
Jamey
container_jquery.html
guest_jquery.html

๏̯͡๏ Jasvir Nagra

unread,
Nov 12, 2012, 2:43:16 PM11/12/12
to Google Caja Discuss
On Thu, Nov 8, 2012 at 11:14 AM, Jamey Wood <jamey...@gmail.com> wrote:
Thanks, Kevin.

The reason I did that is that I'm not clear on how functional and production-ready ES5 mode really is.  When will it no longer be label as Experimental?

ES5 mode is very functional and we're continuing to mark it as experimental till we've closed a few more semantic differences between ES5/3 and ES5 modes that allows legacy code to work more similarly on browsers that run ES5 mode vs browsers that only support ES5/3.  Our plan is to turn off the experimental flag before the end of year.

As one specific example, does it support external javascript library references?  When I change the little test case to use jquery (per the attached files), it stops working in Safari 6.  Is that expected at this point?

Your container code is explicitly forbidding the loading of external resources.  Specifically the second argument to caja.load() is a callback that specifies what URLs you want to allow -- see https://developers.google.com/caja/docs/controllingnetwork/.

If that was just an error in copy and paste, what error message do you get when you run the code on Safari?

jas
Reply all
Reply to author
Forward
0 new messages