Open Bug 1892945 Opened 5 months ago Updated 5 months ago

Optimize add-element code in AddOrUpdateSparseElementHelper

Categories

(Core :: JavaScript Engine, task)

task

Tracking

()

People

(Reporter: jandem, Unassigned, NeedInfo)

Details

(Keywords: perf)

Olli shared a GDocs profile where we're spending a fair amount of time adding sparse properties under AddOrUpdateSparseElementHelper: https://share.firefox.dev/4bpRGlt

Longer-term the right fix for this is bug 1339265, but short-term we could try replacing the AddOrChangeProperty call with a fast path for adding a dense or sparse element. The object is either a plain object or an array, so we don't need the generic add-property-hook call but could instead inline it for arrays similar to the fast path in CallAddPropertyHookDense. There's also some property descriptor overhead we could avoid on this fast path.

Flags: needinfo?(jdemooij)
You need to log in before you can comment on or make changes to this bug.