I'm trying to run microbenchmark on a block of code that generates isochrones (and returns a SpatialPolygonsDataFrame) for a given set of coordinates. However, when I run the code with microbenchmark, it goes on forever. It will not stop. The same code without microbenchmark runs just fine, in under three seconds.
Here's the data:
latlon <- tibble::tribble(
~lon, ~lat,
-69.64605, 44.56423,
-68.760845, 44.821497,
-70.535831, 44.188819
)
Here's the first thing I tried:
isochrone <- microbenchmark( map2(latlon$lon, latlon$lat,
~ osrmIsochrone(loc = c(.x, .y),
breaks = seq(0, 30, 30) )) %>%
do.call(what = rbind)
)
Here's the second thing I tried:
microbenchmark(
isochrone <- map2(latlon$lon, latlon$lat,
~ osrmIsochrone(loc = c(.x, .y),
breaks = seq(0, 30, 30) )) %>%
do.call(what = rbind)
)
This code works fine, but obviously it doesn't return a benchmark:
isochrone <- map2(latlon$lon, latlon$lat,
~ osrmIsochrone(loc = c(.x, .y),
breaks = seq(0, 30, 30) )) %>%
do.call(what = rbind)
I'm not sure it's relevant, but I should note that I'm using an AWS EC2 server to generate the isochrones. I've also tested the same code on a locally running container, and that microbenchmark test also ran forever; without microbenchmark, the code executed flawlessly in under 3 seconds.