It's complicated.

V8 has a so-called "snapshotting" mechanism which is used to speed up
startup. Recently people have been working on using it to cache other code
as well.

That said, this is no silver bullet, as there are a number of inherent
challenges:
- dynamic languages like JavaScript are not well-suited for ahead-of-time
compilation
- generating optimized code depends on having collected type feedback, so
it can't happen up front; it also by definition bakes in a number of
non-cacheable assumptions
- generating non-optimized code, on the other hand, is relatively fast
anyway (unless there's a huge amount of it), so caching it only helps so
much
- assuming you have a working caching mechanism, you need reasonable rules
when to use it, how much disk space you're giving it, how you're making
sure it isn't stale, and so on.
- caching generated code doesn't affect sustained performance (possibly on
the contrary), it can only improve startup time.

So having an explicit and time-consuming "installation"/pre-compilation
phase for JS packages isn't going to happen. However, more automatic
caching under the hood is something you're likely to see in the future
(regardless of where scripts came from -- there's no reason this couldn't
work with regular scripts found on web sites.)


On Tue, Jan 27, 2015 at 3:33 AM, Jiang Kelvin <leiyi...@gmail.com> wrote:

> Not all js files are online, such as the js files in
> extensions/web-apps/application-cache. If we can save the result of
> compilation when installing or upgrading them, and just load and run the
> binary codes when calling a js function(think about the ART of Android), is
> it possible to improve performance?
>
> --
> --
> v8-users mailing list
> v8-users@googlegroups.com
> http://groups.google.com/group/v8-users
> ---
> You received this message because you are subscribed to the Google Groups
> "v8-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to v8-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
-- 
v8-users mailing list
v8-users@googlegroups.com
http://groups.google.com/group/v8-users
--- 
You received this message because you are subscribed to the Google Groups 
"v8-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to v8-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to