Carceral-Ecologies / Carceral-Proximity-Analysis

Working version can be found at...
http://critical-data-analysis.org/shiny/proximity/proximity-app/
GNU General Public License v3.0
1 stars 1 forks source link

Efficiency of Census Tract File Load #9

Open lindsaypoirier opened 4 years ago

lindsaypoirier commented 4 years ago

Swapping between states is currently quite slow because the all of the census tract shapefiles are not set up load by default, but instead are set up to be unzipped and extracted when a new state is selected.

See comments in the server function for more detail on how this is working.

I'm not sure this is the most efficient way to do things. So any help with speeding this up would be appreciated.

lindsaypoirier commented 4 years ago

Try unzipping files by default

lindsaypoirier commented 4 years ago

After some testing, it seems as though it's not the unzipping that's slowing things down, but the loading of the shape file. Not sure if there's any libraries that could speed up shape file reading.

benmillam commented 4 years ago

Update:

This is my interpretation of the profvis profile, however, when I remove the census tracts from the leaflet plot (remove the addPolygons() call), the app is fast again (in line with @lindsaypoirier's original observation of the census tracts being the issue.)

Possible next steps:

benmillam commented 4 years ago

Here's an annotated screenshot of my app profvis profile: image If interested, I'd recommend running profiles on your machine (or the server); (removing the tidyverse piping %>% from the plotting helped for clarity in the profvis output, too.)

benmillam commented 4 years ago

Update: during Tues meeting, Ben to post on RStudio Community