PowerBasic rocks!
- From: John Larkin <jjlarkin@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 13 May 2009 18:27:39 -0700
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
.
- Follow-Ups:
- Re: PowerBasic rocks!
- From: mrdarrett
- Re: PowerBasic rocks!
- From: panteltje
- Re: PowerBasic rocks!
- From: panteltje
- Re: PowerBasic rocks!
- From: Robert Baer
- Re: PowerBasic rocks!
- From: Frank Buss
- Re: PowerBasic rocks!
- From: bill . sloman
- Re: PowerBasic rocks!
- From: Tim Williams
- Re: PowerBasic rocks!
- Prev by Date: Re: What's it worth?
- Next by Date: Re: Of drills, woods, bears, and PIV...
- Previous by thread: FPGA/DSP system design problem
- Next by thread: Re: PowerBasic rocks!
- Index(es):
Relevant Pages
|