Updates:
        Status: WorkingAsIntended

Comment #15 on issue 1630 by [email protected]: Compiled raytrace code is very slow
http://code.google.com/p/v8/issues/detail?id=1630

In your example the array is only 20% occupied. V8 will use a dense representation if it requires less space than the dictionary. In this case it would help to avoid allocating the large array upfront and allocate it as large as needed.

V8 treats Array slightly different from Object because of the .length property and to make bounds checks on arrays efficient. Changing the behavior of Array would be a bigger change and not always a win.

If you need a dynamically growable array, use an Object instead. Here is how to speed it up by using Object instead of Array:

  var v = {};
  var da = 10485760;
  for (var D = 0; D < da; D++)
  {
      v[D] = 0;
  }

I'm closing this as I don't see a need to change anything in V8 for now.

--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to