Open Bug 1557179 Opened 5 years ago Updated 2 years ago

Nuking CCWs can result in quadratic weakmap behavior

Categories

(Core :: JavaScript Engine, defect, P3)

defect

Tracking

()

People

(Reporter: sfink, Unassigned, NeedInfo)

References

Details

Attachments

(1 obsolete file)

The fix for the iterator invalidation problem in bug 1556430 can result in quadratic behavior because it keeps starting over processing the list of WeakMarkables in severWeakDelegate.

Because the list itself is not modified during processing, only the gcWeakKeys table, the simple fix is to restart iteration where we last left off.

Unfortunately, it still has to re-lookup the list for every processed element, but at least that doesn't change the O(n).

Note that the length of the list is determined by the number of distinct weakmaps with a key in common. So it's user-controlled how long the list is and therefore the n in O(n^2), which is unfortunate.

There's a r+ patch which didn't land and no activity in this bug for 2 weeks.
:sfink, could you have a look please?
For more information, please visit auto_nag documentation.

Flags: needinfo?(sphink)
Attachment #9070136 - Attachment is obsolete: true
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: