Open Bug 1339265 Opened 7 years ago Updated 2 months ago
Implement sparse elements storage for objects
Nowadays every native object can have dense elements and that is great. However as soon as some an object becomes sparse, because we added indexed properties to the shape, our performance falls of a cliff. Every other engine has a sparse elements storage, which they can use instead of dense elements storage to optimize those cases. I imagine we would basically have a HashMap of PropertyDescriptors, which will be stored at the NativeObject::elements_ when the object is sparse. Implementing this is probably going to be a significant amount of work, but I think it could be worth it. Both Google Sheets and Facebook use objects as a hashmap with sparse array indexes. Additionally we can't use dense elements for elements that are non-plain properties, so we would have the opportunity to optimize the case where for example a single element is non-writable, or a getter.
You need to log in before you can comment on or make changes to this bug.