|0.1.2||Jan 22, 2023|
|0.1.1||Jan 14, 2023|
|0.1.0||Dec 31, 2022|
#28 in Geospatial
90 downloads per month
rust 2021 edition.
As a example the library can be used to compute the following delaunay mesh.
( computed from 6,000 points on a sphere selected at random )
Currently we have 84% test coverage ( as reported by cargo tarpaulin -o Html )
A collection of d3 sub packages is being ported to rust.
- rust - rust_d3_geo_vornoi/benchmark.
Measuring the performance of a library is compilcated, as different applications employing the library may see different results. Desktop and mobile perfomance may differ.
There are traditionally two way of measuring increases in performance :-
A) Speed: By asking how long it takes to perform a certain computation?
B) Throughput: By asking how much more work can I perfom in a given time?
A and B are ideally linearly related, but often high throughput requires more memory which may increase page swapping. Javascipt uses garbage collection, rust does not. In garbage collected environments, the dynamics of a collectors behaviours may cause the figures reported by A and B to diverge.
Here are the results for the benchmark :-
B) When I increase the number of points given to the RUST version to render, I find I can render 826 in 16ms. An increase in throughput of 37%.
I am currently looking to add more benchmarks, a diverse collection of example application code, will give greater confidence in what to expect.
This workspace contain a binary "profie_target" which outputs the result of a computation similar to that of the demo_page. Before API finialization - I am currently using cargo flamegraph to identify any obvious optimizations.
cargo install flamegraph cargo flamegraph -- profile_target
Currently the demo works only then f64 is used as the floating point type. [For f32 the cell integrity is broken as some of the cell appear to takeup the whole sphere.] To be ported:-
contour.js and geo-contour-test.js
Currenly there is a failing test suite geo_voronoi_test.rs "geoVoronoi.hull does not break on difficult polygons"
Instructions for building the benchmark
The application displays a delaunay mesh of a large number of cells onto a sphere.
- To build and start the web server:-
cd benchmark wasm-pack build cd www npm install npm run start
The last command automatically starts your web browser.
For benchmarking, to obtain best performance
cd benchmark wasm-pack build --release cd www npm install npm run build serve dist/
and then host rust_d3_geo_voronoi/benchmark/dist directory before viewing in a browser. Timing specific information is output to the console.