paleolimbot / geos

Open Source Geometry Engine ('GEOS') R API
https://paleolimbot.github.io/geos/
Other
61 stars 8 forks source link

Add information about performance to the README #91

Closed kadyb closed 1 year ago

kadyb commented 1 year ago

I think you should highlight in the README the benefits of this package, i.e. performance and smaller memory footprint compared to {sf} (and {terra}?).

Buffer example ```r library("sf") library("geos") set.seed(1) n = 1000 df = data.frame(x = rnorm(n), y = rnorm(n)) pts_sf = st_as_sf(df, coords = c("x", "y")) pts_sf = st_as_sfc(pts_sf) pts_geos = as_geos_geometry(pts_sf) t = bench::mark( check = FALSE, iterations = 100, sf = st_buffer(pts_sf, 50, nQuadSegs = 30), geos = geos_buffer(pts_geos, 50, params = geos_buffer_params(quad_segs = 30)) ) t[, 1:5] #> expression min median `itr/sec` mem_alloc #> 1 sf 30.4ms 31.4ms 31.8 4.13MB #> 2 geos 17.4ms 18.2ms 54.9 99.95KB sf = st_buffer(pts_sf, 50, nQuadSegs = 30) format(object.size(sf), units = "auto") #> [1] "2.5 Mb" geos = geos_buffer(pts_geos, 50, params = geos_buffer_params(quad_segs = 30)) format(object.size(geos), units = "auto") #> [1] "71.4 Kb" ```
paleolimbot commented 1 year ago

In general I try not to make a stink about performance comparisons since I largely haven't tested them (I know you've done great work in this area and have a much better idea than I do). In my mind, the benefit of using geos is to accellerate performance-critical steps that benefit from re-using a transformation to/from the GEOS representation (e.g., buffer + something else + something else). I'd like to leave any performance claims to blog posts since they may change over time as the sf implementation evolves as well!

kadyb commented 1 year ago

Fair point!