You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The uniques() function checks if each item is in an array of seen items, which I think leads to quadratic complexity overall. There are probably use cases such as a scatter plot with thousands of points where this would take a noticeable length of time.
Would it be worth making seen a Set? I think it would just need the following changes:
const seen = []; -> const seen = new Set();
seen.includes(computed) -> seen.has(computed)
seen.push(computed) -> seen.add(computed)
The text was updated successfully, but these errors were encountered:
Sorry for the delay! This is now published as v4.1.1! Thanks again! I'll hopefully get some time in the coming two weeks to go over the calcExtents API change, too.
The uniques() function checks if each item is in an array of seen items, which I think leads to quadratic complexity overall. There are probably use cases such as a scatter plot with thousands of points where this would take a noticeable length of time.
Would it be worth making
seen
aSet
? I think it would just need the following changes:const seen = [];
->const seen = new Set();
seen.includes(computed)
->seen.has(computed)
seen.push(computed)
->seen.add(computed)
The text was updated successfully, but these errors were encountered: