Re: [Rd] Suggestion for serialization performance improvement on Windows

From: Henrik Bengtsson <hb_at_stat.berkeley.edu>
Date: Wed, 14 Jul 2010 07:53:18 +0200

On Fri, Jul 9, 2010 at 6:49 AM, Bryan W. Lewis <bwaynelewis_at_gmail.com> wrote:
> Dear R developers,
>
>  The slow performance of serializing to a raw vector on Windows is an
> issue that has appeared in this list before.

My guess is that you are referring to:

[Rd] serialize() to via temporary file is heaps faster than doing it directly (on Windows), 2008-07-24
http://tolstoy.newcastle.edu.au/R/e4/devel/08/07/2355.html

If so, that thread show how unnecessarily slow (5 mins instead of 5 secs) it is on Windows.

> It appears to be due to
> the frequent use of realloc from the resize_buffer method in
> serialize.c.
>
> I suggest a more granular, but still incremental, re-allocation of
> memory. For example change near the top of resize_buffer to:
>
> R_size_t newsize = needed + 65536 - (needed % 65536);
>
> or some other similar small multiple of a typical system page size.

>
> I have found this to dramatically improve performance of serialization
> to raw vectors on Windows.

I second this update, which seems to make serialize(..., connection=NULL) useful in Windows.

Thxs,

Henrik

>
> Best,
>
> Bryan
>
> ______________________________________________
> R-devel_at_r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>



R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Wed 14 Jul 2010 - 05:55:36 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 14 Jul 2010 - 10:30:14 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.

list of date sections of archive