Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Does evalInSandbox take advantage of compile caching?

28 views
Skip to first unread message

Steven Roussey

unread,
Jan 20, 2011, 2:57:21 PM1/20/11
to
I heard that "The sandbox system is in a horrid state at the moment and as far as I know there's no way to take advantage of compile caching with it at all".

Firebug is working to use its own module system based on evalInSandbox. Is this compile caching thing true, and will it even matter?

-steve--

Boris Zbarsky

unread,
Jan 20, 2011, 3:11:46 PM1/20/11
to
On 1/20/11 2:57 PM, Steven Roussey wrote:
> I heard that "The sandbox system is in a horrid state at the moment and as far as I know there's no way to take advantage of compile caching with it at all".
>
> Firebug is working to use its own module system based on evalInSandbox. Is this compile caching thing true, and will it even matter?

The compiled code is not cached.

Whether that matters to you depends on how much code you're stuffing
into evalInSandbox and how often that code is the same as it was before.

-Boris

Steven Roussey

unread,
Jan 20, 2011, 3:44:22 PM1/20/11
to
> Whether that matters to you depends on how much code you're stuffing
> into evalInSandbox and how often that code is the same as it was before.

Well, all of Firebug. But I don't *think* its files would get loaded more the once, so it ought not to matter then..? I'm just looking at John's new module loader, and had some questions. In a way, perhaps it is better not to have a cache of the compile phase using up memory, though I think Firefox itself uses import() instead, so I guess my assumption would be wrong there.

Steven Roussey

unread,
Jan 20, 2011, 4:11:54 PM1/20/11
to
I guess import() caches bytecode between restarts? So that would be an issue?

And then there is the issue of passing objects in and out of the sandbox, which "even if you turn xrays off, you still get proxies because sandboxes have their own sub-processes and compartments"?

-s

0 new messages