Fil / d3-geo-voronoi

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

Improve the comment "find a valid point to send to infinity." #20

Closed martinfrances107 closed 4 years ago

martinfrances107 commented 4 years ago

I really like this project and I am finding it useful.

Javascript is a little slow for my needs so I am current porting the project to rust.

That is why I am pouring over the code section by section.

I hope small changes are acceptable

I found this comment particularly confusing, nothing is being sent to infinity.

Anyway, I hope this is welcome.

Fil commented 4 years ago

I welcome your comments and improvements, and am very curious about the rust port and its speed.

In this case the chosen pivot's is used to define the stereographic projection's rotation in a way that indeed projects it to infinity (at https://github.com/Fil/d3-geo-voronoi/blob/master/src/delaunay.js#L128), so the comment is not wrong. (It can certainly be improved !)

martinfrances107 commented 4 years ago

About the speed.

It is not my first conversion to rust, so I can talk about my experience of other projects.

What is promised by the rust community is an 8 to 10 times speed improvement. (over javascript)

if you align/convert the data structures to the form expected by rust...and that can be a big conversion - I can say I have been able to get a x7 or x8 improvement - Also there is a bottleneck moving data structures from javascript across to the WASM memory model. So, you only get that performance without shifting data back and forwards. (This implies rendering to canvas in RUST)

For my voronoi project ...

I am rendering to canvas a voronoi mesh on a sphere with 6000 points using orthographic projection

I would like to render to SVG but I can save about 30% by rendering to canvas.

From a dependency perspective.. I need to convert d3.geo and d3-geo-voronoi

So as a rough estimate 1000 lines of code.

I will start by converting only what I need to get my project working. I will publish on github under MIT when I have something further to say.

Martin


From: Philippe Rivière notifications@github.com Sent: 14 July 2020 18:44 To: Fil/d3-geo-voronoi d3-geo-voronoi@noreply.github.com Cc: martin frances martinfrances107@hotmail.com; Author author@noreply.github.com Subject: Re: [Fil/d3-geo-voronoi] Improve the comment "find a valid point to send to infinity." (#20)

I welcome your comments and improvements, and am very curious about the rust port and its speed.

In this case the chosen pivot's is used to define the stereographic projection's rotation in a way that indeed projects it to infinity (at https://github.com/Fil/d3-geo-voronoi/blob/master/src/delaunay.js#L128), so the comment is not wrong. (It can certainly be improved !)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/Fil/d3-geo-voronoi/pull/20#issuecomment-658348254, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AAJTTQJH3GRSZHUTOV3QPFTR3SRSHANCNFSM4OZUQBHQ.