I recently had a Microsoft workshop session and became excited about parallel for/foreach/etc.
There we got a solid 60% of efficiency. It means that whenever number of cores increases by 2x, performance is boosted by 1.6x.
I became curious about it, and created a test project to verify the fact for myself.
Here are the results I got on subsequent runs (time in milliseconds + efficiency):
I even got 96% on some early build, which did not show that information clearly (hence, no screenshot).
Two points from here:
- Yes, performance is better on multi-core machines, exactly as expected.
- No, it does not have 100% efficiency, and is in fact very dependent on Windows, with efficiency ranging from 27% to 96%.
It appears to be no way to predict efficiency factor at any given moment, so don’t rely on it too much.
For reference, I am running on a Core 2 Duo E7200 @ 2.53 GHz, which has Windows performance rating of 6.1.
And this is the code (VB.NET console application, using framework 4.0):
|
|