Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[wip] Flat storage for cells. #25

Merged
merged 14 commits into from
Mar 23, 2018
Merged

[wip] Flat storage for cells. #25

merged 14 commits into from
Mar 23, 2018

Conversation

mbostock
Copy link
Member

@mbostock mbostock commented Mar 23, 2018

Fixes #24. Seems to work well?

TODO

  • Update the README.
  • Add more tests.
  • Benchmark?
@mbostock mbostock requested a review from mourner March 23, 2018 04:58
@mourner
Copy link
Collaborator

mourner commented Mar 23, 2018

On a 1 million random sample:

# before
~/projects/voronator master* → node bench
delaunay: 1596.082ms
voronoi: 1477.480ms

# after
~/projects/voronator flat-cell* → node bench
delaunay: 1617.328ms
voronoi: 444.549ms

So, if everything is correct, looks like a further 3x. 🎉

Copy link
Collaborator

@mourner mourner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great to me, pending tests/docs.

Fixes #27. Also improves Delaunay.from so that it more closely matches
Array.from: the specified points can be an array-like object with a length
property or an iterable; an optional this argument can be specified; and the x-
and y-accessors are invoked with the element, index and object as arguments.
@mbostock mbostock merged commit 5f2f339 into master Mar 23, 2018
@mbostock mbostock deleted the flat-cell branch March 23, 2018 19:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants