Status: New
Owner: ----
New issue 3616 by [email protected]: Transitions array grows unbounded
and takes O(N) time to add each transition
https://code.google.com/p/v8/issues/detail?id=3616
When adding a property to an object, if property name looks like a legal
identifier and the number of properties for the object is below a soft
limit, V8 creates a transition to a new hidden class with that property
added, under the assumption that the same thing will probably happen again
later. If the new property has a different name each time this happens, a
new transition is created each time. Since the transitions are stored in a
sorted array, the time taken to add each transition grows every time. This
gets cleaned up during garbage collection, but it's possible to hit a
pathological case where the number of transitions from a single hidden
class grows extremely large between each GC.
The EtchMark benchmark
(http://ie.microsoft.com/testdrive/Performance/EtchMark/) is one example of
this pathological behavior. The following simpler code also demonstrates
the problem:
var objects = [];
for (var i = 0; i < 1000; i++) {
var test = {};
var key = "foo" + i;
test[key] = 0;
objects.push(test);
}
(The size of this array grows with i to 1001 in the above test. Testing on
top websites, the maximum size that a transitions array gets to is about
85.)
--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.