Fil / d3-geo-voronoi

Voronoi / Delaunay tessellations on the sphere
ISC License
229 stars 24 forks source link

#24 - geo_edges(): Now uses the more sematically meaningful "Set" #27

Closed martinfrances107 closed 3 years ago

martinfrances107 commented 3 years ago

This is a discussion point for this issue

https://github.com/Fil/d3-geo-voronoi/issues/26

The change is to use "Set" as a semantically more meaningful data structure.

BUT to avoid a BC break it has a double looping structure which may degrade performance.

martinfrances107 commented 3 years ago

I want to ask questions about the performance of my own work... so I have created a side issue

talking about a uniform approach to bench marking https://github.com/Fil/d3-geo-voronoi/issues/28

Fil commented 3 years ago

I didn't understand the "double looping" you mentioned

martinfrances107 commented 3 years ago

Ah, by "double looping"

I mean a simplistic implementation of "Array.from" would have a iterator or a for loop , looping over all elements

and then the .map() would have a similar but distinct for loop iterating over all elements ...

So ... your solution neatly steps over my "loop twice" argument

Thanks you for correcting me.

Fil commented 3 years ago

gotcha! I was looking for a nested loop 👍