title: Slow graph rendering with ggplot2 / Rstudio - GPU issue?
body: <p>I am making a graph from table that contains circa 500k rows using ggplot2.</p>
  <p>On my ubuntu 20.04 laptop (CPU i5 8265U) it takes around 15 sec and displays correctly in the plot tab of Rstudio. Now i just  got a PC with win 10, a better CPU (i5 10400F) and a GPU (GTX 1660 Super). The same graph takes forever to build. If I wait enough i have the code run in more than 10 mins and still not displayed in the plot tab.</p>
  <p>Unfortunately for me, i cannot share the data so cannot make a reprex, the code for the graph is:</p>
  <pre><code>&gt; t1 &lt;- Sys.time()
  &gt; gr_dbh_h &lt;- tree16_temp %&gt;%
  +   filter(lu_en_simple2 %in% c(&quot;Evergreen Forest&quot;, &quot;Deciduous Forest&quot;)) %&gt;%
  +   select(dbh, h, live_dead, lu_en_simple2_f) %&gt;%
  +   ggplot() +
  +   geom_point(aes(x = dbh, y = h, color = live_dead), alpha = 0.5, shape = 3) +
  +   labs(color = &quot;&quot;, x = &quot;Diameter at breast height (cm)&quot;, y = &quot;Tree total height (m)&quot;) +
  +   facet_wrap(~lu_en_simple2_f)
  &gt; t2 &lt;- Sys.time()
  &gt; t2 - t1
  Time difference of 0.1159708 secs
  &gt; gr_dbh_h
  &gt; t3 &lt;- Sys.time()
  &gt; t3 - t2
  Time difference of 9.901076 mins
  </code></pre>
  <p>Unfortunately again the closest reprex doesn't that same issue and just show a 2 time faster rendering on ubuntu laptop than win10 PC (instead of 60 times in my main code):</p>
  <pre><code>library(tidyverse)
  
  tt  &lt;- tibble(
    x = rnorm(500000),
    y = rnorm(500000),
    cat = rep(c(&quot;aa&quot;, &quot;bb&quot;, &quot;cc&quot;, &quot;dd&quot;, &quot;ee&quot;), 100000),
    group = c(rep(&quot;A&quot;, 200000), rep(&quot;B&quot;, 300000))
  )  
  t1 &lt;- Sys.time()
  ggplot(tt) +
    geom_point(aes(x, y, color = group), alpha = 0.5) +
    facet_wrap(~cat)
  t2 &lt;- Sys.time()
  t2 - t1
  </code></pre>
  <p>on Ubuntu:</p>
  <pre><code>&gt; t2 - t1
  Time difference of 10.26094 secs
  </code></pre>
  <p>on win10:</p>
  <pre><code>&gt; t2 - t1
  Time difference of 23.292 secs
  </code></pre>
  <p><strong>So the main question is how can one system make the graph in 10 sec and the other more than 10 mins? Even with a basic graph first system is 2 times faster?</strong></p>
  <p><strong>Is it just Ubuntu vs Windows? Can the GPU mess up with the rendering?</strong></p>
  <p>Rstudio and R are the same version, packages all up-to-date at the time of writing.</p>
  <pre><code>&gt; sessionInfo()
  R version 4.0.2 (2020-06-22)
  Platform: x86_64-w64-mingw32/x64 (64-bit)
  Running under: Windows 10 x64 (build 18363)
  
  Matrix products: default
  
  locale:
  [1] LC_COLLATE=English_Europe.1252  LC_CTYPE=English_Europe.1252    LC_MONETARY=English_Europe.1252
  [4] LC_NUMERIC=C                    LC_TIME=English_Europe.1252    
  
  attached base packages:
  [1] stats     graphics  grDevices utils     datasets  methods   base     
  
  other attached packages:
   [1] ggthemr_1.1.0   devtools_2.3.1  usethis_1.6.1   webshot_0.5.2   tmap_3.1        bookdown_0.20   knitr_1.29     
   [8] sf_0.9-5        BIOMASS_2.1.3   scales_1.1.1    ggrepel_0.8.2   ggpubr_0.4.0    lubridate_1.7.9 forcats_0.5.0  
  [15] stringr_1.4.0   dplyr_1.0.2     purrr_0.3.4     readr_1.3.1     tidyr_1.1.2     tibble_3.0.3    ggplot2_3.3.2  
  [22] tidyverse_1.3.0
  </code></pre>