Hello, We?re receiving reports of extremely slow rendering by users who are using the new geom_sf() feature in ggplot2. Importantly, this seems to be a graphics device issue, because the exact same plot takes vastly different amounts of time to render under different devices. We?re talking about 2 seconds vs. 100 seconds here, so not a small effect. In particular, the quartz device on OS X seems to be particularly slow. It appears to be the case that geom_sf() (which draws complex polygons for maps) hits a code-path in quartz that hasn?t been well optimized for performance. Importantly, on the same machine where rendering a specific map with quartz takes 100 seconds, I can render the map to pdf *and* open the pdf in Preview in about 2 seconds, so there is no fundamental reason why it should take that long with quartz. For discussion and reproducible examples, please see here: https://github.com/tidyverse/ggplot2/issues/2655 https://community.rstudio.com/t/ggplot2-geom-sf-performance/3251 Best wishes, Claus -- Claus Wilke Professor and Department Chair, Integrative Biology The University of Texas at Austin 2500 Speedway, C0930 Austin, Texas 78712 512 232 2459
Quartz graphic device can be extremely slow in some cases
2 messages · Wilke, Claus O, Juan Telleria Ruiz de Aguirre
It might be related with this files: https://github.com/wch/r-source/blob/trunk/src/library/grDevices/src/devQuartz.c https://github.com/wch/r-source/blob/trunk/src/include/R_ext/QuartzDevice.h Could we port some of the UNIX optimizations to previous code? https://github.com/wch/r-source/blob/trunk/src/library/grDevices/R/unix/quartz.R