realbasic-nug
[Top] [All Lists]

Re: High Performance Code (Was: Bitwise Shift operators)

To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: High Performance Code (Was: Bitwise Shift operators)
From: Frank Condello <developer at chaoticbox dot com>
Date: Sat, 29 Sep 2007 15:02:22 -0400
Delivered-to: listarchive at realsoftware dot com
Delivered-to: realbasic-nug at lists dot realsoftware dot com
References: <BAY107-DAV8132ACB18FF1E0678E2E693B20 at phx dot gbl> <981FFB08-71D3-487B-8A80-4352EE252BB4 at chaoticbox dot com> <2E23AD6D-B086-4475-8213-4C68AB804CFC at great-white-software dot com> <8458FDB7-710C-4350-8FF2-435B36560A6B at declareSub dot com>
---
On 29-Sep-07, at 1:02 PM, Charles Yeomans wrote:

> On Sep 29, 2007, at 12:26 PM, Norman Palardy wrote:
>>
>> What about getting rid of the bitshift ?
>>
>>       i = &h5f375a86 - (i/2)
>
> I tried this (actually i\2).  It saved a few ms, but that's it.

Similar results here - it's definitely faster but still slower than  
the built-in sqrt wrapper.

---
On 29-Sep-07, at 1:46 PM, Marco Bambini wrote:

> What is fast for you?
> I mean, how many Microseconds it should take the FastSqrt function in
> order to be "fast enough"?

I'm not measuring a single call. In a real-world 3D app I have to  
normalize several thousand 3D vectors (among many other things) plus  
draw everything at (ideally) 60Hz. Normalizing the vectors in C code  
(loop and all) using an inlined sqrt approximation is far and beyond  
faster than anything I can muster in RB code - something in the range  
of 20-30 times faster - no exaggeration. In this case "fast enough"  
is literally the difference between getting interactive framerates  
and watching a slideshow.

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>


<Prev in Thread] Current Thread [Next in Thread>