I recently made a small program to test the new GE2 thread system, and to find out, was the whole idea of multi core systems worth it?
So I made this program. It is pretty simple, nothing special just doing the same big function using 2 ways:
a) running the same function using 4 threads.
[THREAD TIME]
b) running the same function 4x times but with single thread(main).
[WITHOUT TIME]I was optimistic that executing threads would be faster then just a function 4x times on my old desktop 1.2Ghz celeron , but the results weren't so promising. They were rather the same:
-------- Finished Benchmark :
(0) THREAD = 76745 , WITHOUT = 77016
(1) THREAD = 76350 , WITHOUT = 77019
(2) THREAD = 76371 , WITHOUT = 77084
(3) THREAD = 76484 , WITHOUT = 77106
-------------------
(TOTAL)[THREAD TIME] = 305950 ms
(TOTAL)[WITHOUT TIME] = 308225 ms
Not much of a difference, the threads are just 3 seconds faster.
But the whole fun and the primary target for my test was the new Dell D620 laptop I have with Core Duo 1.66 Ghz. So the tests results are:
-------- Finished Benchmark :
(0) THREAD = 23955 , WITHOUT = 49530
(1) THREAD = 23941 , WITHOUT = 49490
(2) THREAD = 23963 , WITHOUT = 49489
(3) THREAD = 23924 , WITHOUT = 49484
-------------------
(TOTAL)[THREAD TIME] = 95783 ms
(TOTAL)[WITHOUT TIME] = 197993 msAs you can see the Threads are about 2x times faster then single thread! This is amazing result, at-least for me to see such performance difference.
Generally comparing Core Duo processor with my ol Celeron:
[THREAD] Old =
305950 ms , New
= 95783 ms - About
3 times faster!!!
[WITHOUT]Old =
308225 ms, New
= 197993 ms - About 1,5 times faster
The other interesting thing is to see how the threads actually is using the CPU and cores, here is a screen-shot from taskmanager from my laptop:

You can easily see how the cores are getting used. The big peaks are the times when threads start to work, and automatically consume all the cpu resources, when regular method is used then only one core is fully occupied.
For me I think the threads are really good road to the future, at-least for the next 5 years. And the application using threads would get incredibly powerful boost, comparing to the ordinary single threaded applications.
I can't even imagine what kind of results would be possible to get with Quad core or even Octa core :).
A little update here. Thanks to the help from nts (GameDev.net). I got results measured using the Intel(R) Core(TM)2 Quad CPU @ 2.66GHz. Here they are:
-------- Finished Benchmark :
(0) THREAD = 7103 , WITHOUT = 29246
(1) THREAD = 7113 , WITHOUT = 29216
(2) THREAD = 7105 , WITHOUT = 29167
(3) THREAD = 7111 , WITHOUT = 29168
-------------------
(TOTAL)[THREAD TIME] = 28432 ms
(TOTAL)[WITHOUT TIME] = 116797 msAs you can see on the quad core the performance using thread got increase in about 4x times comparing to only one thread!
Anyway here is the program for you to try:
http://www.hot.ee/knaint/thread_benchmark.zip