Skip to content

serialize/unserialize vector improvement

2 messages · Brian Ripley

#
This has languished for a long time, and we should make a decision 
before FF for 2.15.0.

It seems to me that in so far as there is a problem, it is that we 
serialize via XDR, and that since that was invented little-endian CPUs 
have taken over the world.  So for the only cases I can imagine this is 
really a problem (passing objects in 'parallel'/snow ... contexts) a 
better answer might be to pass without byte-reordering: go back to the 
RDB format which was exposed for save() but AFAIK never for serialize.

I would say Sparc is the only big-endian platform left (some PPC Mac 
users may disagree), so little-endian really does rule.

Brian
On 03/10/2011 14:28, luke-tierney at uiowa.edu wrote:

  
    
4 days later
#
On 22/01/2012 13:56, Prof Brian Ripley wrote:
This does all seem to depend on the quality of the platform's XDR 
implementation: for example, a similar example runs twice as fast on 
x86_64 Mac OS X as on i386 R on the same machine.

On all the (little-endian) platforms I tried not using XDR 
(serialize(xdr = FALSE)) made an improvement of around 3x.  On some a 
version of Spiegel's patch helped equally and on others it made a much 
smaller improvement.  In the best-case scenario (i386 OS X) there was a 
10x improvement.  But that is only going to be noticeable in rare 
applications.

A version of Spiegel's idea (with changes confined to just one file) 
will appear in R-devel shortly.