Thread safety performance on different CPU architectures

A few weeks ago, I did a post on thread safety performance on my machine. However, that was only on one machine, a 2.16 GHz Intel Core Duo architecture.

Yesterday, Joey and I decided to run some more tests of thread safety performance implementations (no thread safety, mutexes, and semaphores) on different architectures, and the results were quite interesting. We ran tests on my machine again, on a 2.16 GHz Intel Core 2 Duo iMac, a 800 GHz PowerPC G4 iMac, and a Quad Core 2.66 GHz Intel Xeon Mac Pro. After running the same tests on each machine, we normalized the data to get rid of the clock-speed factor.

For mutexes, the machines all performed about the same, with my Core Duo doing slightly better than all of the other machines. In second place was the PPC G4, and then the Core 2 Duo machines took up last. For the semaphores, the PPC G4 smoked the Intel chips, a very interesting result.

Here is a summary of our results (the numbers listed are in cycles/5 seconds and the numbers in parenthesis are the normalized data):

Core Duo:
No thread safety: 440909468 (1)
Mutexes: 98324839 (0.223)
Semaphores: 197981 (0.00044)

Core 2 Duo:
No thread safety: 831519248 (1)
Mutexes: 135168338 (0.163)
Semaphores: 1153251 (0.00139)

PowerPC G4:
No thread safety: 119723944 (1)
Mutexes: 23709889 (0.198)
Semaphores: 1020029 (0.00852)

Quad-core Xeon:
No thread safety: 884848737 (1)
Mutexes: 140097898 (0.158)
Semaphores: 1157646 (0.00131)

Here are some charts representing this data:
All data

Mutex performance

Semaphore performance