On Tue, Aug 25, 2009 at 3:46 PM, markyk<[email protected]> wrote:
> Forgetting about compiling for security/obscurity for just a second
> and getting back to the optimisation ...
>
> I have been thinking about this for not just extensions but for other
> large JS libraries and only for startup speed and download size.
> Because this could be used for more than just extensions, please think
> about my comments in broader terms as well.
>
> Standard optimisation practise teaches us that humans can't detect the
> difference in speed if there is less than a 20% improvement, thus if
> you can't get 20% then don't even bother.

Chromium developers will go to significant lengths to get a few
percent speedup for critical operations like page load or startup. It
may not be a perceptible change on its own, but in combination with
other improvements it matters. Also a few percent speedup in one place
can "pay" for increased functionality elsewhere.

> There is a cost of losing platform independence, but in some cases
> that may be acceptable.  There is also a cost involved with managing
> changes in the JS engine and how the precompiled code would
> function.
> Both of these can be offset by compiling on the first run and after
> each JS engine change.

V8 already has support for caching the compiled version of a script.
In fact, most of the standard JavaScript API (Math.*, String.*, etc)
is actually implemented in JavaScript in V8 using this compilation
support. These libraries are compiled on first startup, then cached.
See, for example,
http://code.google.com/p/v8/source/browse/trunk/src/math.js.

> Has anyone looked into it more or done any tests ?

Not yet. Like I said, this is a pretty low priority, but it seems like
a promising direction.

- a

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Chromium-extensions" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/chromium-extensions?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to