speed issues x86 vs strongARM

From: Gernot Frisch (Me_at_Privacy.net)
Date: 06/22/04


Date: Tue, 22 Jun 2004 17:22:41 +0200

Hi,

I have 2 C code snippets that prodcue the same result. However A is 2x
faster than B on my PC (x86) but 1.5x slower on my PDA (strongARM
206MhZ)

// Startup conditions + types
 pSrc = new unsigned short[320*240];
 pDst = new unsigned short[320*240];
 register unsigned short x, y, *ldst;
 short xptch = 320, yptch = -1;
 dst = pDst + 319;
 src = pSrc;

// A:
  (unsigned long*) pDisplay = (unsigned long*)dst;
  for(x=0; x<240; x++)
  {
   for(y=0; y<160; y++)
   {
    *pDisplay++ = (*(src-240)<<16) | *(src); // Process 4 bytes at
once
    src-=480;
   }
   src+=76801; // (320*240+1); // Get a row ahead+320 lines down to
the bottom
  }

// B:
  for (y = 0; y < 320; y++ )
  {
   ldst = dst; // Get current line address
   for (x = 0; x < 240; x++ )
   {
    *(ldst) = *src++; // one pixel right on src
    ldst += xptch; // add a pixel to the right on dest
   }
   dst += yptch; // add a line to dst buffer
  }

Can someone explain it to me. An better: How to make this really fast?
Example B shows what it does obviuosly, I think.

Thank you in advice,

-- 
-Gernot
int main(int argc, char** argv) {printf
("%silto%c%cf%cgl%ssic%ccom%c", "ma", 58, 'g', 64, "ba", 46, 10);}
________________________________________
Looking for a good game? Do it yourself!
GLBasic - you can do
www.GLBasic.com


Relevant Pages

  • Re: Computer with better-than-x86 processor thats not extremely expensive?
    ... or slower than x86 depends on your application. ... here that at one point the DEC Alpha processor, now "dead", running an ... x86 emulator was actually faster than a real x86 machine at the time. ...
    (comp.arch)
  • Re: Computer with better-than-x86 processor thats not extremely expensive?
    ... or slower than x86 depends on your application. ... here that at one point the DEC Alpha processor, now "dead", running an ... x86 emulator was actually faster than a real x86 machine at the time. ...
    (comp.arch)
  • Re: .net
    ... for x86 are horribly slow, much slower than regular calls. ...
    (comp.lang.functional)
  • Re: Windows on OS X at native speeds; that didnt take long
    ... but what a pain in the ass just to run IE6 for testing. ... zero. ... There might be less endian hassles on x86, but it takes a better CPU to simulate a lesser one. ... G-4 runs XP via Virtual PC emulation at an exponentially slower speed than XP runs on a real PC. ...
    (comp.sys.mac.advocacy)
  • Re: Free VMware?
    ... Bochs runs Windows, DOS, Linux, and other x86 operating systems. ... NT4 running on a 900 MHz IBM laptop under Bochs CVS from September seems ... slower on a 600 MHz UltraSPARC IIe. ...
    (comp.os.linux.misc)