Re: [BLACKBOX] INTEGER arithmetic speed

From: [at]} <Wojtek>
Date: Wed, 19 Oct 2011 17:26:55 -0400

----boundary-LibPST-iamunique-59527889_-_-
Content-type: text/plain

Here are some benchmarks from September 2005.

http://www.passmark.com/forum/showthread.php?t&1




> Hmmm.
> That's an interesting point.
>
> I am not an expert in Intel CPU internals, however, let me share some
> thoughts:
>
> No, I don't think that FPU is used with LONGINT, though it can be found
> out by disassembling the binaries. Or is there a way to get an asm
> output? I guess no, and Blackbox directly generates binaries without
> extra step with an assembler.
> FPU is used with REAL and LONGREAL, and that's not convenient (to my
> knowledge) to use FPU for LONGINT, and then cast it.
>
> May be 32bit Intel CPUs work faster with eax, ebx registers, which I
> suppose should be used for LONGINT, than with ax, bx, which are probably
> used when dealing with INTEGERs.
> And I guess that behaviour may change from one cpu version to other.
>
> Norayr
>
> On 10/19/11 19:54, Campbell, Robert (SELEX GALILEO, UK) wrote:
>> I have developed an algorithm that uses LONGINTs, and for a particular
>> input takes
>> 3.5 minutes to run.
>>
>> I don't always need such large numbers, so I cut-and-pasted an INTEGER
>> version, which gives the same
>> results for this input, but takes 5 minutes.
>>
>>
>> Is this a freak result (maybe to do with cache boundaries or something),
>> or is it a general
>> situation that INTEGER arithmetic is 50% slower than LONGINT arithmetic
>> - the algorithm has a
>> varied mix of MODs, DIVs, adds, PROCEDURE calls, and assigments to&
>> from ARRAYs?
>>
>>
>> Regards
>>
>> Robert
>> SELEX Galileo Ltd
>> Registered Office: Sigma House, Christopher Martin Road, Basildon, Essex
>> SS14 3EL
>> A company registered in England& Wales. Company no. 02426132
>> ********************************************************************
>> This email and any attachments are confidential to the intended
>> recipient and may also be privileged. If you are not the intended
>> recipient please delete it from your system and notify the sender.
>> You should not copy it or use it for any purpose nor disclose or
>> distribute its contents to any other person.
>> ********************************************************************
>>
>>
>> ----
>> To unsubscribe, send a message with body "SIGNOFF BLACKBOX" to
>> LISTSERV{([at]})nowhere.xy
>>
>
>
> ----
> To unsubscribe, send a message with body "SIGNOFF BLACKBOX" to
> LISTSERV{([at]})nowhere.xy
>
>


----
To unsubscribe, send a message with body "SIGNOFF BLACKBOX" to LISTSERV{([at]})nowhere.xy----boundary-LibPST-iamunique-59527889_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"
e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzcyBBcmlhbDt9DQp7XGYxXGZtb2Rlcm4gQ291cmllciBOZXc7fQ0Ke1xmMlxmbmlsXGZjaGFy
c2V0MiBTeW1ib2w7fQ0Ke1xmM1xmbW9kZXJuXGZjaGFyc2V0MCBDb3VyaWVyIE5ldzt9fQ0Ke1xj
b2xvcnRibFxyZWQwXGdyZWVuMFxibHVlMDtccmVkMFxncmVlbjBcYmx1ZTI1NTt9DQpcdWMxXHBh
cmRccGxhaW5cZGVmdGFiMzYwIFxmMFxmczIwIEhlcmUgYXJlIHNvbWUgYmVuY2htYXJrcyBmcm9t
IFNlcHRlbWJlciAyMDA1LlxwYXINClxwYXINCmh0dHA6Ly93d3cucGFzc21hcmsuY29tL2ZvcnVt
L3Nob3d0aHJlYWQucGhwP3Q9MjYxXHBhcg0KXHBhcg0KXHBhcg0KXHBhcg0KXHBhcg0KPiBIbW1t
LlxwYXINCj4gVGhhdCdzIGFuIGludGVyZXN0aW5nIHBvaW50LlxwYXINCj5ccGFyDQo+IEkgYW0g
bm90IGFuIGV4cGVydCBpbiBJbnRlbCBDUFUgaW50ZXJuYWxzLCBob3dldmVyLCAgbGV0IG1lIHNo
YXJlIHNvbWVccGFyDQo+IHRob3VnaHRzOlxwYXINCj5ccGFyDQo+IE5vLCBJIGRvbid0IHRoaW5r
IHRoYXQgRlBVIGlzIHVzZWQgd2l0aCBMT05HSU5ULCB0aG91Z2ggaXQgY2FuIGJlIGZvdW5kXHBh
cg0KPiBvdXQgYnkgZGlzYXNzZW1ibGluZyB0aGUgY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W5kIGEgbWVzc2FnZSB3aXRoIGJvZHkgIlNJR05PRkYgQkxBQ0tC
T1giIHRvIExJU1RTRVJWQExJU1RTLk9CRVJPTi5DSFxwYXINCn0
----boundary-LibPST-iamunique-59527889_-_---
Received on Wed Oct 19 2011 - 23:26:55 UTC

This archive was generated by hypermail 2.3.0 : Thu Sep 26 2013 - 06:30:10 UTC