You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed repr_geojson can be quite slow with larger datasets. I think that's because repr_geojson is rendering the entire object as geojson here. Would it be possible to subset the portion that will be displayed before converting to geojson?
library(repr)
# Demo spatial data from sfnc<-sf::read_sf(system.file("shape/nc.shp", package="sf"))
nc_big<-nc[rep(seq_len(nrow(nc)), 1000), ] # copy 1000 times
nrow(nc_big)
#> 100000nc_no_geom<-sf::st_drop_geometry(nc)
nc_big_no_geom<-sf::st_drop_geometry(nc_big)
# No difference in non-geo reprbench::mark(repr(nc_no_geom), repr(nc_big_no_geom), check=FALSE)
#> expression min median `itr/sec` mem_alloc `gc/sec` n_itr n_gc#> <bch:expr> <bch:> <bch:> <dbl> <bch:byt> <dbl> <int> <dbl>#> 1 repr(nc_no_geom) 3.2ms 3.54ms 253. 98.6KB 6.28 121 3#> 2 repr(nc_big_no_geom) 3.16ms 3.46ms 287. 98.6KB 6.32 136 3# nc_big is about 1000x slower in repr_geojsonbench::mark(repr_geojson(nc), repr_geojson(nc_big), check=FALSE)
#> expression min median `itr/sec` mem_alloc `gc/sec` n_itr n_gc#> <bch:expr> <bch:> <bch:> <dbl> <bch:byt> <dbl> <int> <dbl>#> 1 repr_geojson(nc) 14.1ms 16ms 59.7 1.66KB 5.97 30 3#> 2 repr_geojson(nc_big) 17.4s 17.4s 0.0575 1.53MB 4.03 1 70
The text was updated successfully, but these errors were encountered:
I noticed
repr_geojson
can be quite slow with larger datasets. I think that's becauserepr_geojson
is rendering the entire object as geojson here. Would it be possible to subset the portion that will be displayed before converting to geojson?The text was updated successfully, but these errors were encountered: