Updates:
Status: WorkingAsIntended
Comment #1 on issue 1851 by [email protected]: Accessing "const"s from
the environment is significantly slower than accessing "var"s.
http://code.google.com/p/v8/issues/detail?id=1851
This is a consequence of two things:
1. (V8's implementation of) the semantics of const. Reading and writing a
const both require extra runtime checks in V8.
2. const is not part of the ES5 (nor ES3 spec). V8's implementation is
solely for web compatibility and it is therefore not a priority for us to
make it fast.
When const is included in an EcmaScript spec, we will implement the spec
semantics and worry about optimization at that time. As a temporary
workaround for the next year or so, you should use var.
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev