Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2013-04

Vector Pascal (AKA Glasgow Pascal etc.)

1 message · 1 person ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Mark Morgan Lloyd

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.

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]

Reply by email