----boundary-LibPST-iamunique-2004024293_-_-
Content-type: text/plain
I had also tried some with the sample Rex had given:
Added a relation between len of array and outer loop count, keeping the
number of multiplications constant.
Variing the len parameter shows the effect of the cache.
The major bottle neck here I believe is the the memory access, anyway.
mc
CONST len = 20000;
VAR a, b: ARRAY len OF REAL;
i, j: INTEGER; sum: REAL;
t0: LONGINT;
PROCEDURE Test1*;
VAR i, j: INTEGER; sum: REAL;
BEGIN
t0 := Services.Ticks();
sum:= 0;
FOR j:= 1 TO 10000000 DIV len DO
FOR i:= 0 TO len - 1 DO
a[i]:= i-j;
b[i]:= i-j;
END;
FOR i:= 0 TO len - 1 DO
sum:= sum + (len - a[i]) * (len - b[i])
END;
END;
StdLog.Int((Services.Ticks() - t0));
StdLog.Real(sum); StdLog.Ln;
END Test1;
-----Original Message-----
From: blackbox{([at]})nowhere.xy
Skulski
Sent: Friday, November 03, 2006 16:22
To: BlackBox Mailing List
Subject: [BlackBox] - Speed test
Rex:
could you please post the code for the unrolled loops?
I am not sure how you did it.
Also, can please someone add Matlab to the list of tested compilers?
W
On Fri, 3 Nov 2006, Marco Ciot wrote:
> Loop unrolling would certainly for the innermost loop of a cascaded loop
> including index multiplications.
>
> -----Original Message-----
> From: blackbox{([at]})nowhere.xy> Couture
> Sent: Friday, November 03, 2006 06:46
> To: BlackBox Mailing List
> Subject: [BlackBox] - P.S. Re: [BlackBox] - Speed test
>
>
> Oops. Unrolling the loop manually was a quickly done
afterthought.
> The 6 s is a mistake, of course. Unrolling the loop in the BB program
> doesn't seem to have any effect. Maybe the compiler did it.
>
> Rex Couture
>
> --- BlackBox
> --- send subject HELP or UNSUBSCRIBE to blackbox{([at]})nowhere.xy>
> --- BlackBox
> --- send subject HELP or UNSUBSCRIBE to blackbox{([at]})nowhere.xy>
>
--- BlackBox
--- send subject HELP or UNSUBSCRIBE to blackbox{([at]})nowhere.xy
--- BlackBox
--- send subject HELP or UNSUBSCRIBE to blackbox{([at]})nowhere.xy
----boundary-LibPST-iamunique-2004024293_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"
e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzcyBBcmlhbDt9DQp7XGYxXGZtb2Rlcm4gQ291cmllciBOZXc7fQ0Ke1xmMlxmbmlsXGZjaGFy
c2V0MiBTeW1ib2w7fQ0Ke1xmM1xmbW9kZXJuXGZjaGFyc2V0MCBDb3VyaWVyIE5ldzt9fQ0Ke1xj
b2xvcnRibFxyZWQwXGdyZWVuMFxibHVlMDtccmVkMFxncmVlbjBcYmx1ZTI1NTt9DQpcdWMxXHBh
cmRccGxhaW5cZGVmdGFiMzYwIFxmMFxmczIwIEkgaGFkIGFsc28gdHJpZWQgc29tZSB3aXRoIHRo
ZSBzYW1wbGUgUmV4IGhhZCBnaXZlbjpccGFyDQpBZGRlZCBhIHJlbGF0aW9uIGJldHdlZW4gbGVu
IG9mIGFycmF5IGFuZCBvdXRlciBsb29wIGNvdW50LCBrZWVwaW5nIHRoZVxwYXINCm51bWJlciBv
ZiBtdWx0aXBsaWNhdGlvbnMgY29uc3RhbnQuXHBhcg0KVmFyaWluZyB0aGUgbGVuIHBhcmFtZXRl
ciBzaG93cyB0aGUgZWZmZWN0IG9mIHRoZSBjYWNoZS5ccGFyDQpUaGUgbWFqb3IgYm90dGxlIG5l
Y2sgaGVyZSBJIGJlbGlldmUgaXMgdGhlIHRoZSBtZW1vcnkgYWNjZXNzLCBhbnl3YXkuXHBhcg0K
XHBhcg0KbWNccGFyDQpccGFyDQpccGFyDQpcdGFiIENPTlNUIGxlbiA9IDIwMDAwO1xwYXINClxw
YXINClx0YWIgXHRhYiBWQVIgYSwgYjogQVJSQVkgbGVuIE9GIFJFQUw7XHBhcg0KXHRhYiBcdGFi
IFx0YWIgaSwgajogSU5URUdFUjsgIHN1bTogUkVBTDtccGFyDQpcdGFiIFx0YWIgXHRhYiB0M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