[R-SIG-Mac] Poor plotting performance on Mac OS X
Ashley Betts
Ashley.Betts at saltbushsoftware.com
Thu Jul 6 13:13:03 CEST 2017
Hi All,
I'm quite new to R and recently started investigating the geospatial plotting capabilities of R via ggplot2. I started by using some of the publicly available datasets from the Australian Bureau of Statistics. Plotting the Level 3 Statistical Area boundaries took over 2 hours on my 2012 Mac Book Pro. As there were over 3M rows in the fortify’ed data frame I initially thought this was just how long it must take. I then ran the exact same script on my work laptop which is similarly spec’ed and it ran in approximately 30 seconds. This now has me extremely disappointed in the performance on the Mac which is where I use R the most. I changed my BLAS library to the Accelerate library in a whim that this might make a difference. It did not. Whilst I primarily use RStudio I also ran the same script in R.app and if there was any improvement it was not noticeable. I did notice in the Windows run that it seemed to use multiple cores (which is what made me investigate the BLAS change) whilst the Mac seems to stay bound to a single core. My initial thoughts were that it must be something to do with ggplot but after sampling the rsession process a number of times (see attached Sample of rsession.txt) it appears to be spending most of it’s time in CGContextDrawPath in Apples CoreGraphics so I assume it is a Graphics related issue. I’m running R 3.4 on my Mac and 3.3.2 on the Windows machine. I’ve attached the script, process sample text and a number of screen shots that I hope will be helpful in analysing the issue. Could someone possibly let me know if this is PEBKAC issue or an actual problem with R. If the later how do I go about getting the issue resolved?
The SA3 boundary data is available here:
http://www.abs.gov.au/AUSSTATS/abs@.nsf/DetailsPage/1270.0.55.001July%202016?OpenDocument
as 'Statistical Area Level 3 (SA3) ASGS Ed 2016 Digital Boundaries in ESRI Shapefile Format’
Regards,
Ashley
-------------- next part --------------
A non-text attachment was scrubbed...
Name: aus_pop_analysis.R
Type: application/octet-stream
Size: 2843 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-sig-mac/attachments/20170706/007f7b8c/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: macplottimes.tiff
Type: image/tiff
Size: 190178 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-sig-mac/attachments/20170706/007f7b8c/attachment-0003.tiff>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: macsessioninfo.tiff
Type: image/tiff
Size: 321732 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-sig-mac/attachments/20170706/007f7b8c/attachment-0004.tiff>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: MacSysSpec.tiff
Type: image/tiff
Size: 64430 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-sig-mac/attachments/20170706/007f7b8c/attachment-0005.tiff>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: Sample of R.txt
URL: <https://stat.ethz.ch/pipermail/r-sig-mac/attachments/20170706/007f7b8c/attachment-0002.txt>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: Sample of rsession.txt
URL: <https://stat.ethz.ch/pipermail/r-sig-mac/attachments/20170706/007f7b8c/attachment-0003.txt>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: WinCallStack.PNG
Type: image/png
Size: 51034 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-sig-mac/attachments/20170706/007f7b8c/attachment-0005.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: winplottimes.PNG
Type: image/png
Size: 13331 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-sig-mac/attachments/20170706/007f7b8c/attachment-0006.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: winprofile.PNG
Type: image/png
Size: 28479 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-sig-mac/attachments/20170706/007f7b8c/attachment-0007.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: WinSessionInfo.PNG
Type: image/png
Size: 24825 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-sig-mac/attachments/20170706/007f7b8c/attachment-0008.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: WinSysSpec.PNG
Type: image/png
Size: 7198 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-sig-mac/attachments/20170706/007f7b8c/attachment-0009.png>
More information about the R-SIG-Mac
mailing list