PowerBasic rocks!





I just tried a test loop to add an array of 64 million 16-bit signed
integers into an array of 32-bit signed integers. This is to get an
idea of how long a signal averaging (summing, actually) thing might
take on a Pentium based SBC.

On my HP winXP desktop, writing a very dumb PowerBasic loop...

FOR Y = 1 TO 10

FOR X = 1 TO 64000000
S(X) = S(X) + A(X)
NEXT

NEXT

(where X, Y, and S() are longs)

this takes 2.25 seconds, or 0.225 seconds to do the 64M sum. That's
3.6 nanoseconds per loop iteration.

I could rewrite this using pointers and it might be faster.

We tried it on a Kontron MiniITX SBC, in C, with pointers, Linux but
with a wimpier processor, and got about the same run time.

We'll acquire 64M samples once a second or so, so the signal averaging
doesn't look like a showstopper. I was impressed.

There may be some MAC/array instructions buried in the x86
architecture that might be even faster.

John

.



Relevant Pages

  • Re: PowerBasic rocks!
    ... I just tried a test loop to add an array of 64 million 16-bit signed ... integers into an array of 32-bit signed integers. ... I could rewrite this using pointers and it might be faster. ...
    (sci.electronics.design)
  • Re: Byte swapping efficiently
    ... signed integers into an array is about the best I can expect. ... Data(DataX, DataY) = ByteSwap ... DataX = DataX + 1 ... The Datatwo-dimensional array is declared as private single, ...
    (microsoft.public.vb.general.discussion)
  • Re: PowerBasic rocks!
    ... integers into an array of 32-bit signed integers. ... We'll acquire 64M samples once a second or so, so the signal averaging ... Well, the old array iterator LODSW, followed by ops, followed by ... I don't know MMX instructions, so you'll have to look that up ...
    (sci.electronics.design)
  • Re: Changing the data type of an array
    ... But as I know that it is indeed an array ... > of 16 bit signed integers, I have to go through a data ... > conversion process. ... every pair of bytes as a signed int16. ...
    (comp.soft-sys.matlab)
  • Changing the data type of an array
    ... I am using MATLAB to communicate with a remote instrument (logic ... But as I know that it is indeed an array ... of 16 bit signed integers, I have to go through a data ... conversion process. ...
    (comp.soft-sys.matlab)