PSN-L Email List Message

Subject: Fwd: Re: Basic Programming Help desired?
From: Kevin Brunt k.brunt@.........
Date: Thu, 8 May 2008 22:50:18 +0100 (BST)



Hi,

I think that you'll find that PUTting a 32768 byte array will be broadly comparable in time to BSAVEing the same array.

The timing issues that you have been having are almost certainly due to the manipulation of individual array elements. Your first program was appending each byte to the end of a string one-by-one; I suspect that appending a byte to an N byte string consists of creating a new N+1 byte string, copying the N byte string to it and adding the new byte to the end - the original N byte string is then discarded. The observed delays are due to the repeated copying.

Your later program wrote one byte at a time to the file; since there will be a (largely) fixed overhead for each call to PUT, 2^15 calls to PUT takes a lot longer than one call.

Incidentally, I've been lurking in the PSN-L archives because I've been working on a PDP-11 (in a museum) that used to be used for seismic processing. The equivalent program to yours in PDP-11 assembler (for the RT-11 operating system) is probably no longer than your BASIC programs, and RT-11 can perform the write-to-disk while the program is filling up the next buffer. (Admittedly, the PDP-11 has 4 6-foot high 19-inch cabinets, each with its own mains lead....)

Kevin

>Date: Thu, 8 May 2008 13:55:50 -0700
>From: Geoff   

>Hello Mr. Brunt ;
>Yes you are basically correct.
>But speed of saving the array is the real issue.
>I have tried just about everything but found
>nothing faster than using the BSAVE command.

>ps; I never tried to put a complete array in a single
>operation. Did not know that was possible.
>I still think BSAVE will be faster.
__________________________________________________________

Public Seismic Network Mailing List (PSN-L)


[ Top ] [ Back ] [ Home Page ]