I see it gets discussed here once every three or four years, but I just thought I'd throw in that I've been playing briefly with the Vector (AKA Glasgow) compiler and get a quite impressive speedup when telling it to compile for two cores rather than one:
0 1> time ./test # Compiled for 1 core
real 0m18.753s
user 0m18.733s
sys 0m0.000s
0 1> time ./test # Compiled for two cores
real 0m11.908s
user 0m20.425s
sys 0m2.036s
Test program, based on an example in their manual:
program Test;
var i: integer;
procedure sub2d;
type range= 0..127;
var x, y, z: array[range, range] of single { real } ;
begin
x := y - z
end;
begin
{ WriteLn('Hello, World!') }
for i := 0 to 65535 do
sub2d
end.I know it's pretty crappy and doesn't initialise variables etc., but I was interested to see if it really did distribute work properly.
I note FPC's undocumented -Sv option from earlier discussion, but it appears not to like the 2D array so compilation fails at the subtraction.
