Its possible but the same 9X factor seems to appear even when there is code
inside the loop that cannot be optimised out altogether.
For example I also did a run as follows:
dim u as integer = Count * 4
for j as integer = 0 to iterations
for i as integer = 0 to u step 4
pB.Single(i) = pA.Single(i) * j
Next
Next
////////////
And the RB version that calls C:
for i as integer = 0 to Count
copySingle ( i, A, B )
Next
//// C code ////////
void copySingle (int count, float * A, float * B ) {
int i;
for ( i = 0; i < count ; i++ ) {
B[i] = A[i] * count ;
}
};
////////////
On 16/5/07 16:27, "Norman Palardy" <[EMAIL PROTECTED]>
wrote:
>
> On 16-May-07, at 9:04 AM, Daniel Stenning wrote:
>
>> Actually - I've just remembered - even that isnt it.
>>
>> I did a rerun earlier where I simply commented out the code inside
>> the
>> nested loops. This would eliminate any issues due to virtual method
>> calls.
>>
>> Naturally the timings fell for both RB and C. But to my surprise
>> RB was
>> STILL around 9 times slower than C !.
>
> You're sure the C loop didn't get optimized right out ?
> _______________________________________________
> Unsubscribe or switch delivery mode:
> <http://www.realsoftware.com/support/listmanager/>
>
> Search the archives:
> <http://support.realsoftware.com/listarchives/lists.html>
>
Regards,
Dan
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>