From bwaynelewis at gmail.com  Fri Jul  9 06:49:29 2010
From: bwaynelewis at gmail.com (Bryan W. Lewis)
Date: Fri, 9 Jul 2010 00:49:29 -0400
Subject: [Rd] Suggestion for serialization performance improvement on Windows
Message-ID: <AANLkTimwIiK0sBwpnhQv9cPS2LJzwsVlTD9splgANzxP@mail.gmail.com>

Dear R developers,

  The slow performance of serializing to a raw vector on Windows is an
issue that has appeared in this list before. 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.

Best,

Bryan



[Rd] Suggestion for serialization performance improvement on Windows
Bryan W. Lewis