Open Bug 1339265 Opened 8 years ago Updated 1 year ago

Implement sparse elements storage for objects

Categories

(Core :: JavaScript Engine, defect, P3)

defect

Tracking

()

People

(Reporter: evilpie, Unassigned)

References

(Blocks 3 open bugs)

Details

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.
Blocks: 1500481
Severity: normal → S3
Blocks: 1851371
You need to log in before you can comment on or make changes to this bug.