tc39 / proposal-set-methods

Proposal for new Set methods in JS
https://tc39.github.io/proposal-set-methods/
Other
655 stars 15 forks source link

Revisit intersection algorithm based on JSC's Set implementation #91

Closed rkirsling closed 1 year ago

rkirsling commented 1 year ago

Just making a note here, based on our Matrix conversation:

We need to discuss in next plenary whether we'd like to update the spec for intersection, having identified that JSC cannot "[determine] the relative order of two elements ... without needing to iterate the entire [receiver set]" under its existing Set implementation. (A Set in JSC is a hashmap with a linked list of buckets for iteration.)

bakkot commented 1 year ago

We'll discuss this at the March meeting. If anyone has ideas for possible paths forward, please suggest them - right now all I've got are

bakkot commented 1 year ago

In plenary resolved to just drop the sort step, and live with the order depending on the relative sizes of the sets. I'll update the spec soon and close this issue at that point.