[#7055] More on VC++ 2005 — Austin Ziegler <halostatue@...>

Okay. I've got Ruby compiling. I'm attempting to get everything in

17 messages 2006/01/05
[#7058] Re: More on VC++ 2005 — nobuyoshi nakada <nobuyoshi.nakada@...> 2006/01/06

Hi,

[#7084] mathn: ugly warnings — hadmut@... (Hadmut Danisch)

Hi,

22 messages 2006/01/10
[#7097] Re: mathn: ugly warnings — Daniel Berger <Daniel.Berger@...> 2006/01/10

Hadmut Danisch wrote:

[#7098] Design contracts and refactoring (was Re: mathn: ugly warnings) — mathew <meta@...> 2006/01/10

Daniel Berger wrote:

[#7118] Re: Design contracts and refactoring (was Re: mathn: ugly warnings) — mathew <meta@...> 2006/01/12

*Dean Wampler *<deanwampler gmail.com> writes:

[#7226] Fwd: Re: Question about massive API changes — "Sean E. Russell" <ser@...>

Hello,

23 messages 2006/01/28
[#7228] Re: Question about massive API changes — Caleb Tennis <caleb@...> 2006/01/28

>

Re: PATCH: append option to sysread

From: Phil Tomson <rubyfan@...>
Date: 2006-01-31 05:51:00 UTC
List: ruby-core #7257
On 1/30/06, Yohanes Santoso <ysantoso-rubycore@jenny-gnome.dyndns.org> wrote:
> Hi,
>
> It is hard to do efficient incremental IO, a method where you just
> keep on buffering until you have a complete message in the buffer, in
> ruby because you end up creating many new objects.
>
> Here is a patch to IO#sysread that allows it to append to the given
> string instead of replacing it (1.8.x behaviour).
>
> Attached also the test script, test_io.rb, that simulates a
> pathological case of incremental IO.
>
> Basically the test would loop until it reads 10MB of data, on each
> loop it tries to detect for an end of message marker (which of course
> does not exist since this is a pathological case).
>
> Three methods are tested:
> 1. array method
> each return from io#sysread is appended into the array and then the
> array is joined and scanned for EOM.
>
> 2. concat method
> append the return value of io#sysread into a string and scan the
> string for EOM.
>
> 3. fastio method
> io#sysread appends read data into the given string and then scan the
> string for EOM.
>
>
> ~/tmp/ruby-1.8.4 $ ./ruby test_io.rb
> Reference content initialized. Size: 10485760 octets
>                         user     system      total        real
> array 10M           1.550000   1.020000   2.570000 (  2.784659)
> concat 10M          1.500000   1.080000   2.580000 (  2.755901)
> fastio 10M          0.510000   0.040000   0.550000 (  0.663247)
>

Maybe instead of the patch you send, this should be made into an
extension.  However, the problem is that you need to use a macro
(READ_DATA_BUFFERED) which is defined in io.c.  Shouldn't these
#define's be in .h files, not .c files so that the macros defined are
accessable by extension writers?

Phil


In This Thread