1. Machine.E suggestion. Was: Re: Jiri Fonts; Zero length...

On Sat, 31 Oct 1998, Robert Craig wrote:

> Ralf writes:
> > [Zero Length Terminator]
> > I'm shocked. RDS fix this for the next release, if you are not
> > planning on providing a patch. Take for example EDOM.
> > I just found one of the reasons of the mysterious crashes.
> > I sometimes have a lot of zero's in the sequence I puts to the file.
>
> Try opening a file for write-binary "wb", (or even write "w").
> The zeros will be written out just as you expect.

Reading this message reminded me of something.

A little experimentation with my file SPLITter revealed that Euphoria
automatically buffers 8192 bytes (8k) before even thinking about accessing
disk.

The most recent version of SPLIT implements its own buffering, but
Euphoria's 8k is still being used.

Would it be possible to add a function or procedure somewhere in the
language (machine.e is a good place, hence subject) that alters Euphoria's
buffer size.
Example Manual segment:

-------------------------------<set_buffer>------------------------------

Platform:    Should work in both really...

Syntax:      include machine.e
             i2 = set_buffer(i1)

Description: Sets the size of the input/output buffer(s). The buffer fills
             on a read, or doesn't write until the buffer is full,
             depending on the current operation.
             Returns the new buffer size.

Comments:    If i1 = 0, the current buffer size is returned. No changes.
             If i1 <= 8192 (8 Kb) then the buffer size is set to 8192.
                 This is the lower limit. 8192 is returned.
             If setting to i1 would use up too much memory, 0 is returned.
             If there are files in operation (!) -1 is returned.

Example:     size = set_buffer(size)
             if size = -1 then
                 puts(2, "Files are open!")
             elsif not size then
                 puts(2, "Buffers unchanged!")
             else
                 printf(1, "Buffers are now at %1.2gKb.", {size/1024})
             end if

See Also:    open, close, ?allocate?

---------------------------------------------------------------------------

--
Carl R White -- Final Year Computer Science at the University of Bradford
E-mail...: cyrek- at -bigfoot.com -- Remove the hyphens before mailing. Ta :)
URL......: http://www.bigfoot.com/~cyrek/
Ykk rnyllaqur rgiokc cea nyemdok ymc giququezka caysgr -- B.Q.Vgesa

new topic     » topic index » view message » categorize

2. Re: Machine.E suggestion. Was: Re: Jiri Fonts; Zero length...

Carl R. White writes:
> Would it be possible to add a function or procedure somewhere
> in the language (machine.e is a good place, hence subject) that alters
> Euphoria's buffer size.

It would be possible, but I don't think it would buy you very much.
Beyond 8K I think you get into diminishing returns.

Regards,
     Rob Craig
     Rapid Deployment Software
     http://members.aol.com/FilesEu/

new topic     » goto parent     » topic index » view message » categorize

3. Re: Machine.E suggestion. Was: Re: Jiri Fonts; Zero length...

On Tue, 3 Nov 1998, Robert Craig wrote:

> Carl R. White writes:
> > Would it be possible to add a function or procedure somewhere
> > in the language (machine.e is a good place, hence subject) that alters
> > Euphoria's buffer size.
>
> It would be possible, but I don't think it would buy you very much.
> Beyond 8K I think you get into diminishing returns.

Rob Craig:

I benchmarked SPLITs 0.10 and 0.15. 0.15 is on average 40% faster than
its predecessor. I buffer the information upto 1.44Mb (optimised for
floppysp.bat) and then write it out. Granted, there's still Euphoria's 8k
doing its thing underneath it all. That's a 1% increase every 36k, using
*coded* buffering. If Euphoria did it, it'd be even quicker...

Everyone:

Incidentally, I'm working on a long filename version of SPLIT that
reads/writes directly from floppies, but it's extremely annoying to find
that Long Filenames don't work in DOS Mode. (But they do in a DOS box...)
YAMS! [Yet Another Micro$oft Scam]

--
Carl R White -- Final Year Computer Science at the University of Bradford
E-mail...: cyrek- at -bigfoot.com -- Remove the hyphens before mailing. Ta :)
URL......: http://www.bigfoot.com/~cyrek/
Ykk rnyllaqur rgiokc cea nyemdok ymc giququezka caysgr -- B.Q.Vgesa

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu