Skip to content

Benchmark 'js' and 'cpp' versions of concaveman algorithm

License

Notifications You must be signed in to change notification settings

mpadge/concavetest

Repository files navigation

concavetest

Test package to benchmark Mapbox’s ‘concaveman’ algorithm in both javascipt and C++ versions.

if (!"concavetest" %in% rownames (installed.packages ()))
    remotes::install_github("mpadge/concavetest")
library (concavetest)
library (rbenchmark)
n <- 1e4
x <- runif (n)
y <- runif (n)
knitr::kable (rbenchmark::benchmark (
                                     c_js (x, y),
                                     c_cpp (x, y),
                                     replications = 100))
test replications elapsed relative user.self sys.self user.child sys.child
2 c_cpp(x, y) 100 1.603 1.000 1.588 0.013 0 0
1 c_js(x, y) 100 10.060 6.276 10.294 0.084 0 0

And C++ is loads faster than javascript. The end.

About

Benchmark 'js' and 'cpp' versions of concaveman algorithm

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published