On 16-May-07, at 3:27 PM, Daniel Stenning wrote:

> On 16/5/07 18:44, "Frank Condello" <[EMAIL PROTECTED]> wrote:
>>
>> Daniel's profiling a loop that uses direct Ptr access - there are no
>> function calls.
>
>  actually this is something I'd like clarified - when I use
> myPtr.Single(offset) is RB calling a function or does the compiler  
> merely
> interpret this syntax and generate machine code to retrieve/set the
> dereferenced data directly ? ( ala C ).

Everything I've read and been told by RS engineers leads me to  
believe that Ptr.Single is not a function call (it would be kinda  
pointless and redundant if it was).

>> basically this test is
>> flawed. Daniel's code is making a function call in the dylib case and
>> no function calls in the RB case so if all things were equal RB
>> should've been _way_ faster, not just marginally faster.
>
> I don't quite get your point here. I simply wrote the most  
> efficient code to
> do the task in either case.  Its not a matter of like for like.  
> Although I
> do understand such a test might be useful in finding out where the  
> slowdown
> occurs.

But the comparison is flawed - one loop makes a function call into a  
dylib and the other makes no functions calls at all. Function call  
overhead can (and does in this case) negate any advantage your dylib  
code may have. Put both loops in the dylib and call the function once  
if you want a "fair" test.

>> For a proper comparison the C loop would need to contain the outer
>> loop as well - Trust me, I've done a lot of testing here myself, and
>> even when using Ptr and all the appropriate pragmas C loops simply
>> spank RB loops in real world applications.
>
> I guess we are basically in agreement then. It remains for RS to  
> find out
> why looping is so slow in RB and improve things.

They've already closed your report stating that RB is faster - and it  
is in this case, because the test is flawed ;)

I've added a comment to your report pointing out the flawed logic in  
the code and in the evaluation, but I'm not sure anyone from RS will  
even read that comment since the report is closed. A new report with  
a more equivalent C vs RB test might be worth pursuing, but there are  
plenty of "make RB go faster" requests in the database already.

Frank.
<http://developer.chaoticbox.com/>


_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to