Skip to content
Prev 49667 / 63424 Next

Request to speed up save()

On 15/01/2015 12:45, Stewart Morris wrote:
Sounds like bad practice on your part ... saving images is not 
recommended for careful work.
It is not an 'algorithm', it is a command-line utility widely available 
for Linux at least.
Why do that if you are at all interested in speed?  A pointless (and 
inaccurate) binary to decimal conversion is needed.
But R does not by default save bzip2-ed ASCII images ... and gzip is the 
default because its speed/compression tradeoffs (see ?save) are best for 
the typical R user.

And your last point is a common misunderstanding, that people typically 
have lots of spare cores which are zero-price.  Even on my 8 (virtual) 
core desktop when I typically do have spare cores, using them has a 
price in throttling turbo mode and cache contention.  Quite a large 
price: an R session may run 1.5-2x slower if 7 other tasks are run in 
parallel.
Not in base R.  For example one would need a linkable library, which the 
site you quote is not obviously providing.

Nothing is stopping you writing a sensible uncompressed image and 
optionally compressing it externally, but note that for some file 
systems compressed saves are faster because of reduced I/O.