forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Why is the Cell architecture fast, if at all?

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PS3 Development
View previous topic :: View next topic  
Author Message
Neels



Joined: 19 Dec 2006
Posts: 5

PostPosted: Wed Dec 20, 2006 11:18 am    Post subject: Why is the Cell architecture fast, if at all? Reply with quote

Hi,

I did some basic benchmarking on the ps3 against a P4 2,8GHZ both on the PPU and the SPU, and well, my P4 beats the ps3 in every test. Only when using 7 threads or more on the SPU, the ps3 beats my P4, but only with little difference. My Pentium D 3,4G would kill the ps3 again.

Some tests:

Code:

Calculating prime numbers up to 200000:

Pentium 4 2,8GHZ: 13234ms
Pentium 4 3,4GHZ: 9828ms
Playstation3 PPU: 25247ms
Playstation3 SPU: 33264ms

Simple loop length 10 million:

- 1 integer-add
- 1 if
- 2 float-adds
- 1 float-muls
- 1 float-div
               
Pentium 4 2,8 GHZ 1 Thread   946ms

PS3 SPE 1 Thread             4019ms
PS3 SPE 7 Threads            1147ms
PS3 SPE 16 Threads           772ms

Calculating mandelbrot fractal graphics:

Pentium 4 2,8 GHZ       11103ms
PS3 SPE 1 Thread        16137ms
PS3 PPU                 40290ms


What are good things to test on a PS3? I tested the vector types a bit but multiplication of vec_float4 consume four times more time than muls with float, so why shall I use the ps3 vector types?

Nils
Back to top
View user's profile Send private message
Neels



Joined: 19 Dec 2006
Posts: 5

PostPosted: Wed Dec 20, 2006 11:59 am    Post subject: Reply with quote

Meanwhile, I did some memory tests which are quite interesting to look at:

Code:


memcpy 10GB (10240 times 1MB)

P4 2,8GHZ DDR1:        12024ms
P4 3,4GHZ DDR2:        6234ms
PS3 PPU:               5120ms
PS3 SPU:               2736ms
PS3 SPU 7 Threads:     781ms



Last edited by Neels on Wed Dec 20, 2006 10:57 pm; edited 1 time in total
Back to top
View user's profile Send private message
ooPo
Site Admin


Joined: 17 Jan 2004
Posts: 2032
Location: Canada

PostPosted: Wed Dec 20, 2006 1:20 pm    Post subject: Reply with quote

Keep in mind that having a videogame console that has even that much raw computing power is quite an achievement on its own. Typically more effort is put into the graphics hardware and the cpu just limps along.

Perhaps you're seeing the lack of maturity in the PS3 toolchain, or maybe code could be better optimized to work around some of the quirks like the lack of branch prediction. Still, that memcpy speed is interesting. Keep at it - I'm interested in why it is performing like that.
Back to top
View user's profile Send private message Visit poster's website
Shine



Joined: 03 Dec 2004
Posts: 728
Location: Germany

PostPosted: Wed Dec 20, 2006 1:38 pm    Post subject: Re: Why is the Cell architecture fast, if at all? Reply with quote

Neels wrote:
I did some basic benchmarking on the ps3 against a P4 2,8GHZ both on the PPU and the SPU, and well, my P4 beats the ps3 in every test. Only when using 7 threads or more on the SPU, the ps3 beats my P4, but only with little difference. My Pentium D 3,4G would kill the ps3 again.


Could you post the benchmarking code and some info about the compiler, P4 OS and compiler settings you have used? Did you specified "-O2" on PS3, used a 64 bit version of GCC and a version > 4?
Back to top
View user's profile Send private message
soks



Joined: 25 May 2004
Posts: 100
Location: Chicago, IL

PostPosted: Wed Dec 20, 2006 2:01 pm    Post subject: Reply with quote

Mind you although GCC will compile for the Cell it is FAR from optimized and using the IBM compiler will show much better numbers.

At least that's what I learned from the Cell online courses.
Back to top
View user's profile Send private message AIM Address
rapso



Joined: 28 Mar 2005
Posts: 147

PostPosted: Wed Dec 20, 2006 5:22 pm    Post subject: Re: Why is the Cell architecture fast, if at all? Reply with quote

Neels wrote:

Code:

PS3 SPE 1 Thread             4019ms
PS3 SPE 7 Threads            1147ms
PS3 SPE 16 Threads           772ms


if you have a speedup when using more threads than SPUs available, then there is an other bottleneck than just raw computation power. make some simpler tests like some vector multiplications.
Back to top
View user's profile Send private message
Neels



Joined: 19 Dec 2006
Posts: 5

PostPosted: Wed Dec 20, 2006 10:17 pm    Post subject: Reply with quote

Here is the memcpy-Benchmark code:

Code:

#define MEMCPY_SIZE   1048576      // 1MB

unsigned int dobenchmark_memcpy()
{
   unsigned char* pDataSrc = (unsigned char*)malloc(sizeof(unsigned char) * MEMCPY_SIZE);
   unsigned char* pDataDst = (unsigned char*)malloc(sizeof(unsigned char) * MEMCPY_SIZE);

   unsigned int i=0;

   for( i=0; i<MEMCPY_SIZE; i++ )
      pDataSrc[i] = i;

   for( i=0; i<1024*10; i++ )   // 10GB
   {
      // fortunately, this loop isn't optimized away, so just memcpy here...
      memcpy( pDataDst, pDataSrc, sizeof(unsigned char) * MEMCPY_SIZE );
   }

   unsigned int result = pDataDst[0];
   for( i=1; i<MEMCPY_SIZE; i++ )
   {
      result += pDataDst[i];
   }

   free(pDataSrc);
   free(pDataDst);
   return result;
}


The whole functions is measured, but when doing only one memcpy the time is 6ms on my P4 so I don't care.

The P4 is the following machine:

Intel Pentium 4 521 2,8GHZ 1MB Cache
RAM noname DDR1 2GB
Mainboard Asrock 775i65GV
OS Windows XP Professional SP2
Benchmark Code compiled with Intel C++ Compiler 8.0
Back to top
View user's profile Send private message
misfire



Joined: 06 Sep 2004
Posts: 120
Location: Germany

PostPosted: Wed Dec 20, 2006 11:50 pm    Post subject: Reply with quote

The German c't magazine has recently tested the PS3's processor capabilities.

The PS3 reached a SPECint_2000 base score of 400, which is comparable to an Athlon at 1,33 GHz. Also, they wrote that both Cell and the Xbox360 processor aren't any good at single-threaded applications.

The Cell only excels at processing when using the SPUs, which are optimised for calculating single-precision floating-point numbers. With 6 active SPUs, the PS3 is twice as fast as a Core 2 Duo 6400. (Then again, the Core 2 easily beats the PS3 when it comes to double-precision.)

This might be an explanation for your test results, Neels.
Back to top
View user's profile Send private message
Saotome



Joined: 03 Apr 2004
Posts: 182

PostPosted: Thu Dec 21, 2006 1:24 am    Post subject: Reply with quote

@Neels:
you might find this thread on beyond3d interesting, especially the posts from "inefficient". The people in that thread are also trying to benchmark the PS3 / PPU / SPEs, but they are already on page 9, so you might find some ideas how to optimize, which they already found out ;)

btw. I don't understand how you're using memcpy on SPE, what memory are you copying to where? Is it LS (LocalStore) -> LS, XDR -> XDR, etc ??
What confuses me the most about it, is that SPEs have 256kB memory but you're copying 1MB at once.
_________________
infj
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PS3 Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group